8
8
def create_data_row_upload_dict (client :labelboxClient , table :pd .core .frame .DataFrame ,
9
9
row_data_col :str , global_key_col :str , external_id_col :str , dataset_id_col :str ,
10
10
dataset_id :str , metadata_index :dict , attachment_index :dict ,
11
- divider :str , verbose :bool ):
11
+ divider :str , verbose :bool , extra_client : bool = None ):
12
12
""" Multithreads over a Pandas DataFrame, calling create_data_rows() on each row to return an upload dictionary
13
13
Args:
14
14
client : Required (labelbox.client.Client) - Labelbox Client object
@@ -22,15 +22,16 @@ def create_data_row_upload_dict(client:labelboxClient, table:pd.core.frame.DataF
22
22
attachment_index : Required (dict) - Dictonary where {key=column_name : value=attachment_type}
23
23
divider : Required (str) - String delimiter for all name keys generated
24
24
verbose : Required (bool) - If True, prints details about code execution; if False, prints minimal information
25
+ extra_client : Ignore this value - necessary for other labelbase integrations
25
26
Returns:
26
27
Two values:
27
28
- global_key_to_upload_dict - Dictionary where {key=global_key : value=data row dictionary in upload format}
28
29
- errors - List of dictionaries containing conversion error information; see connector.create_data_rows() for more information
29
30
"""
30
- table_length = connector .get_table_length_function (table = table )
31
+ table_length = connector .get_table_length_function (table = table , extra_client = extra_client )
31
32
if verbose :
32
33
print (f'Creating upload list - { table_length } rows in Pandas DataFrame' )
33
- if table_length != connector .get_unique_values_function (table = table , column_name = global_key_col ):
34
+ if table_length != connector .get_unique_values_function (table = table , column_name = global_key_col , extra_client = extra_client ):
34
35
print (f"Warning: Your global key column is not unique - upload will resume, only uploading 1 data row per unique global key" )
35
36
metadata_schema_to_name_key = labelbase .metadata .get_metadata_schema_to_name_key (client = lb_client , lb_mdo = False , divider = divider , invert = False )
36
37
metadata_name_key_to_schema = labelbase .metadata .get_metadata_schema_to_name_key (client = lb_client , lb_mdo = False , divider = divider , invert = True )
0 commit comments