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

Commit a7db629

Browse files
Update client.py
1 parent 3b5c351 commit a7db629

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

labelpandas/client.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ def create_data_rows_from_table(
8686

8787
# Create a dictionary where {key=global_key : value=data_row_upload_dict} - this is unique to Pandas
8888
global_key_to_upload_dict, data_row_conversion_errors = connector.create_data_row_upload_dict(
89-
lb_client=self.lb_client, table=table,
90-
row_data_col=row_data_col, global_key_col=global_key_col, external_id_col=external_id_col,
91-
metadata_index=metadata_index, local_files=local_files, divider=divider, verbose=verbose
89+
client=self.lb_client, table=table, row_data_col=row_data_col,
90+
global_key_col=global_key_col, external_id_col=external_id_col, metadata_index=metadata_index,
91+
attachment_index=attachment_index, local_files=local_files, divider=divider, verbose=verbose
9292
)
9393

9494
# If there are conversion errors, let the user know; if there are no successful conversions, terminate the upload
@@ -115,20 +115,21 @@ def create_data_rows_from_table(
115115
)
116116

117117
# Create a dictionary where {key=project_id : value=list_of_data_row_ids}, if applicable
118-
project_id_to_batch_dict = connector.create_batches(
118+
project_id_to_batch_dict, batch_to_project_errors = connector.create_batches(
119119
client=self.lb_client, table=table, global_key_col=global_key_col,
120120
project_id_col=project_id_col, global_key_to_data_row_id=global_key_to_data_row_id
121121
)
122122

123123
# Batch data rows to projects, if applicable
124-
batch_results = uploader.batch_rows_to_project(
125-
client=self.lb_client, project_id_to_batch_dict, priority=priority
126-
)
124+
if not batch_to_project_errors:
125+
batch_to_project_errors = uploader.batch_rows_to_project(
126+
client=self.lb_client, project_id_to_batch_dict, priority=priority
127+
)
127128

128129
# Create a dictionary where {key=project_id : value=annotation_upload_list}, if applicable
129130
project_id_to_upload_dict, annotation_conversion_errors = connector.create_annotation_upload_dict(
130131
client=self.lb_client, table=table, row_data_col=row_data_col, global_key_col=global_key_col,
131-
project_id_col=project_id_col, annotation_index=annotation_index
132+
project_id_col=project_id_col, annotation_index=annotation_index, divider=divider, verbose=verbose
132133
)
133134

134135
# Upload your annotations to Labelbox, if applicable
@@ -138,7 +139,8 @@ def create_data_rows_from_table(
138139

139140
return {
140141
"data_row_upload_results" : data_row_upload_results,
141-
"data_row_conversion_errors" : data_row_conversion_errors,
142+
"data_row_conversion_errors" : data_row_conversion_errors,
143+
"batch_to_project_errors" : batch_to_project_errors
142144
"annotation_upload_results" : annotation_upload_results,
143145
"annotation_conversion_errors" : annotation_conversion_errors
144146
}

0 commit comments

Comments
 (0)