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

Commit 7d4584a

Browse files
Update client.py
1 parent f0d9ff3 commit 7d4584a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

labelpandas/client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,25 @@ def create_data_rows_from_table(self, df:pd.core.frame.DataFrame, lb_dataset:lab
4646
Returns:
4747
List of errors from data row upload - if successful, is an empty list
4848
"""
49+
50+
# Ensure all your metadata_index keys are metadata fields in Labelbox and that your Pandas DataFrame has all the right columns
4951
df = self.base_client.sync_metadata_fields(
5052
table=df, get_columns_function=connector.get_columns_function, add_column_function=connector.add_column_function,
5153
get_unique_values_function=connector.get_unique_values_function, metadata_index=metadata_index, verbose=verbose
5254
)
5355

56+
# If df returns False, the sync failed
5457
if type(df) == bool:
5558
return None
5659

60+
# Create a dictionary where {key=global_key : value=labelbox_upload_dictionary} - this is unique to Pandas
5761
global_key_to_upload_dict = connector.create_upload_dict(
5862
df=df, local_files=local_files, lb_client=self.lb_client,
59-
row=row, row_data_col=row_data_col, global_key_col=global_key_col,
63+
row_data_col=row_data_col, global_key_col=global_key_col,
6064
external_id_col=external_id_col, metadata_index=metadata_index, divider=divider
6165
)
6266

67+
# Upload your data rows to Labelbox
6368
upload_results = self.base_client.batch_create_data_rows(
6469
dataset=lb_dataset, global_key_to_upload_dict=global_key_to_upload_dict,
6570
skip_duplicates=skip_duplicates, divider=divider

0 commit comments

Comments
 (0)