@@ -43,7 +43,9 @@ def create_data_rows_from_table(
43
43
verbose : Required (bool) - If True, prints information about code execution
44
44
divider : Optional (str) - String delimiter for all name keys generated
45
45
Returns:
46
- List of errors from data row upload and a list of errors from table conversion - if either is successful, is an empty list
46
+ A dictionary with "upload_results" and "conversion_errors" keys
47
+ - "upload_results" key pertains to the results of the data row upload itself
48
+ - "conversion_errors" key pertains to any errors related to data row conversion
47
49
"""
48
50
49
51
# Ensure all your metadata_index keys are metadata fields in Labelbox and that your Pandas DataFrame has all the right columns
@@ -54,7 +56,7 @@ def create_data_rows_from_table(
54
56
55
57
# If df returns False, the sync failed - terminate the upload
56
58
if type (df ) == bool :
57
- return [], []
59
+ return { "upload_results" : [], "conversion_errors" : []}
58
60
59
61
# Create a dictionary where {key=global_key : value=labelbox_upload_dictionary} - this is unique to Pandas
60
62
global_key_to_upload_dict , conversion_errors = connector .create_upload_dict (
@@ -70,15 +72,15 @@ def create_data_rows_from_table(
70
72
print (f'Data row upload will continue - the first return value will be data row upload results' )
71
73
else :
72
74
print (f'Data row upload will not continue' )
73
- return [], errors
75
+ return { "upload_results" : [], "conversion_errors" : errors }
74
76
75
77
# Upload your data rows to Labelbox
76
78
upload_results = self .base_client .batch_create_data_rows (
77
79
dataset = lb_dataset , global_key_to_upload_dict = global_key_to_upload_dict ,
78
80
skip_duplicates = skip_duplicates , divider = divider , verbose = verbose
79
81
)
80
82
81
- return upload_results , conversion_errors
83
+ return { " upload_results" : upload_results , " conversion_errors" : conversion_errors }
82
84
83
85
# def upsert_table_metadata():
84
86
# return table
0 commit comments