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

Commit d30b0a9

Browse files
Update client.py
1 parent c359458 commit d30b0a9

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

labelpandas/client.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ def create_data_rows_from_table(self, df:pd.core.frame.DataFrame, lb_dataset:lab
3232
global_key_col=None, external_id_col=None, metadata_index:dict={}, skip_duplicates:bool=False, divider="___", verbose:bool=False):
3333
""" Creates Labelbox data rows given a Pandas table and a Labelbox Dataset
3434
Args:
35-
df : Required (pandas.core.frame.DataFrame) - Pandas dataframe to-be-uploaded
35+
df : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
3636
lb_dataset : Required (labelbox.schema.dataset.Dataset) - Labelbox dataset to add data rows to
37-
row_data_col : Required (str) - Column name where the data row row data URL is located
38-
local_files : Required (bool) - If True, will create urls for local files / If False, treats the values in `row_data_col` as urls
39-
global_key_col : Optional (str) - Column name where the data row global key is located - defaults to the row_data column
40-
external_id_col : Optional (str) - Column name where the data row external ID is located - defaults to the row_data column
41-
metadata_index : Optional (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type must be one of "enum", "string", "datetime" or "number"
37+
row_data_col : Required (str) - Column containing asset URL or file path
38+
local_files : Required (bool) - If True, will create urls for local files; if False, uploads `row_data_col` as urls
39+
global_key_col : Optional (str) - Column name containing the data row global key - defaults to row data
40+
external_id_col : Optional (str) - Column name containing the data row external ID - defaults to global key
41+
metadata_index : Required (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type = "enum", "string", "datetime" or "number"
4242
skip_duplicates : Optional (bool) - If True, will skip duplicate global_keys, otherwise will generate a unique global_key with a suffix "_1", "_2" and so on
43-
divider : Optional (str) - If skip_duplicates=False, uploader will auto-add a suffix to global keys to create unique ones, where new_global_key=old_global_key+divider+clone_counter
43+
divider : Optional (str) - String delimiter for all name keys generated
4444
verbose : Required (bool) - If True, prints information about code execution
4545
Returns:
4646
List of errors from data row upload - if successful, is an empty list
47-
"""
47+
"""
4848

4949
# Ensure all your metadata_index keys are metadata fields in Labelbox and that your Pandas DataFrame has all the right columns
5050
df = self.base_client.sync_metadata_fields(
@@ -66,7 +66,7 @@ def create_data_rows_from_table(self, df:pd.core.frame.DataFrame, lb_dataset:lab
6666
# Upload your data rows to Labelbox
6767
upload_results = self.base_client.batch_create_data_rows(
6868
dataset=lb_dataset, global_key_to_upload_dict=global_key_to_upload_dict,
69-
skip_duplicates=skip_duplicates, divider=divider
69+
skip_duplicates=skip_duplicates, divider=divider, verbose=verbose
7070
)
7171

7272
return upload_results

0 commit comments

Comments
 (0)