@@ -46,20 +46,25 @@ def create_data_rows_from_table(self, df:pd.core.frame.DataFrame, lb_dataset:lab
46
46
Returns:
47
47
List of errors from data row upload - if successful, is an empty list
48
48
"""
49
+
50
+ # Ensure all your metadata_index keys are metadata fields in Labelbox and that your Pandas DataFrame has all the right columns
49
51
df = self .base_client .sync_metadata_fields (
50
52
table = df , get_columns_function = connector .get_columns_function , add_column_function = connector .add_column_function ,
51
53
get_unique_values_function = connector .get_unique_values_function , metadata_index = metadata_index , verbose = verbose
52
54
)
53
55
56
+ # If df returns False, the sync failed
54
57
if type (df ) == bool :
55
58
return None
56
59
60
+ # Create a dictionary where {key=global_key : value=labelbox_upload_dictionary} - this is unique to Pandas
57
61
global_key_to_upload_dict = connector .create_upload_dict (
58
62
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 ,
60
64
external_id_col = external_id_col , metadata_index = metadata_index , divider = divider
61
65
)
62
66
67
+ # Upload your data rows to Labelbox
63
68
upload_results = self .base_client .batch_create_data_rows (
64
69
dataset = lb_dataset , global_key_to_upload_dict = global_key_to_upload_dict ,
65
70
skip_duplicates = skip_duplicates , divider = divider
0 commit comments