Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 0f6535a

Browse files
Update connector.py
1 parent 8caec65 commit 0f6535a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

labelpandas/connector.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from labelbase import Client as baseClient
22
from labelbox import Client
33
import pandas
4+
from tqdm import tqdm
45
from concurrent.futures import ThreadPoolExecutor, as_completed
56

67
def create_upload_dict(df:pandas.core.frame.DataFrame, lb_client:Client, base_client:baseClient, row_data_col:str,
@@ -37,9 +38,14 @@ def create_upload_dict(df:pandas.core.frame.DataFrame, lb_client:Client, base_cl
3738
global_key_col, external_id_col, metadata_index, local_files, divider
3839
)
3940
)
40-
for f in as_completed(futures):
41-
res = f.result()
42-
global_key_to_upload_dict[str(res["global_key"])] = res
41+
if verbose:
42+
for f in tqdm(as_completed(futures)):
43+
res = f.result()
44+
global_key_to_upload_dict[str(res["global_key"])] = res
45+
else:
46+
for f in as_completed(futures):
47+
res = f.result()
48+
global_key_to_upload_dict[str(res["global_key"])] = res
4349
if verbose:
4450
print(f'Generated upload list - {len(global_key_to_upload_dict)} data rows to upload')
4551
return global_key_to_upload_dict

0 commit comments

Comments
 (0)