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

Commit 7a1742f

Browse files
Update connector.py
1 parent 5d917e0 commit 7a1742f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

labelpandas/connector.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def create_upload_dict(table:pandas.core.frame.DataFrame, lb_client:Client, row_
2727
- global_key_to_upload_dict - Dictionary where {key=global_key : value=data row dictionary in upload format}
2828
- errors - List of dictionaries containing conversion error information; see connector.create_data_rows() for more information
2929
"""
30+
global_key_col = global_key_col if global_key_col else row_data_col
31+
external_id_col = external_id_col if external_id_col else global_key_col
3032
if verbose:
31-
print(f'Creating upload list - {len(table)} rows in Pandas DataFrame')
33+
print(f'Creating upload list - {get_table_length_function(table)} rows in Pandas DataFrame')
3234
if get_table_length_function(table=table) != get_unique_values_function(table=table, column_name=global_key_col):
33-
print(f"Warning: Your global key column is not unique - upload will resume, only uploading 1 data row for duplicate global keys")
34-
global_key_col = global_key_col if global_key_col else row_data_col
35-
external_id_col = external_id_col if external_id_col else global_key_col
35+
print(f"Warning: Your global key column is not unique - upload will resume, only uploading 1 data row for duplicate global keys")
3636
metadata_schema_to_name_key = get_metadata_schema_to_name_key(client=lb_client, lb_mdo=False, divider=divider, invert=False)
3737
metadata_name_key_to_schema = get_metadata_schema_to_name_key(client=lb_client, lb_mdo=False, divider=divider, invert=True)
3838
with ThreadPoolExecutor(max_workers=8) as exc:

0 commit comments

Comments
 (0)