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

Commit 9b5f443

Browse files
Update connector.py
1 parent c952bdf commit 9b5f443

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

labelpandas/connector.py

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def create_upload_dict(table:pandas.core.frame.DataFrame, lb_client:Client, base
3030
"""
3131
if verbose:
3232
print(f'Creating upload list - {len(table)} rows in Pandas DataFrame')
33+
if get_table_length_function(table=table) != get_unique_values_function(table=table, column_name=global_key_col):
34+
print(f"Warning: Your global key column is not unique - upload will resume, only uploading 1 data row for duplicate global keys")
3335
global_key_col = global_key_col if global_key_col else row_data_col
3436
external_id_col = external_id_col if external_id_col else global_key_col
3537
metadata_schema_to_name_key = base_client.get_metadata_schema_to_name_key(lb_mdo=False, divider=divider, invert=False)
@@ -146,3 +148,12 @@ def add_column_function(table:pandas.core.frame.DataFrame, column_name:str, defa
146148
"""
147149
table[column_name] = default_value
148150
return table
151+
152+
def get_table_length_function(table:pandas.core.frame.DataFrame):
153+
""" Tells you the size of a Pandas DataFrame
154+
Args:
155+
table : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
156+
Returns:
157+
The length of your table as an integer
158+
"""
159+
return len(table)

0 commit comments

Comments
 (0)