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

Commit c359458

Browse files
Update connector.py
1 parent de50804 commit c359458

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

labelpandas/connector.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ def create_upload_dict(df:pandas.core.frame.DataFrame, local_files:bool, lb_clie
88
""" Multithreads over a Pandas DataFrame, calling create_data_rows() on each row to return an upload dictionary
99
Args:
1010
df : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
11-
local_files : Required (bool) - If True, will create urls for local files / If False, treats the values in `row_data_col` as urls
11+
local_files : Required (bool) - If True, will create urls for local files; if False, uploads `row_data_col` as urls
1212
lb_client : Required (labelbox.client.Client) - Labelbox Client object
1313
base_client : Required (labelbase.client.Client) - Labelbase Client object
14-
row_data_col : Required (str) - Column name where the data row row data URL is located
15-
global_key_col : Optional (str) - Column name where the data row global key is located - defaults to the row_data_col
16-
external_id_col : Optional (str) - Column name where the data row external ID is located - defaults to the global_key_col
17-
metadata_index : Optional (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type must be one of "enum", "string", "datetime" or "number"
18-
divider : Optional (str) - String delimiter to separate metadata field names from their metadata answer options in your metadata_name_key_to_schema dictionary
14+
row_data_col : Required (str) - Column containing asset URL or file path
15+
global_key_col : Optional (str) - Column name containing the data row global key - defaults to row data
16+
external_id_col : Optional (str) - Column name containing the data row external ID - defaults to global key
17+
metadata_index : Required (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type = "enum", "string", "datetime" or "number"
18+
divider : Optional (str) - String delimiter for all name keys generated
1919
Returns:
2020
Two items - the global_key, and a dictionary with "row_data", "global_key", "external_id" and "metadata_fields" keys
2121
"""
@@ -42,18 +42,18 @@ def create_upload_dict(df:pandas.core.frame.DataFrame, local_files:bool, lb_clie
4242
def create_data_rows(local_files:bool, lb_client:Client, row:pandas.core.series.Series,
4343
metadata_name_key_to_schema:dict, metadata_schema_to_name_key:dict,
4444
row_data_col:str, global_key_col:str="", external_id_col:str="", metadata_index:dict={}, divider:str="///"):
45-
""" Function to-be-multithreaded to create data row dictionaries from a Pandas table
45+
""" Function to-be-multithreaded to create data row dictionaries from a Pandas DataFrame
4646
Args:
47-
local_files : Required (bool) - If True, will create urls for local files / If False, treats the values in `row_data_col` as urls
47+
local_files : Required (bool) - If True, will create urls for local files; if False, uploads `row_data_col` as urls
4848
lb_client : Required (labelbox.client.Client) - Labelbox Client object
49-
row : Required (pandas.core.series.Series) - Pandas row object
50-
row_data_col : Required (str) - Column name where the data row row data URL is located
51-
global_key_col : Optional (str) - Column name where the data row global key is located - defaults to the row_data_col
52-
external_id_col : Optional (str) - Column name where the data row external ID is located - defaults to the global_key_col
53-
metadata_index : Required (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type must be one of "enum", "string", "datetime" or "number"
49+
row : Required (pandas.core.series.Series) - Pandas Row object
50+
row_data_col : Required (str) - Column containing asset URL or file path
51+
global_key_col : Optional (str) - Column name containing the data row global key - defaults to row data
52+
external_id_col : Optional (str) - Column name containing the data row external ID - defaults to global key
53+
metadata_index : Required (dict) - Dictionary where {key=column_name : value=metadata_type} - metadata_type = "enum", "string", "datetime" or "number"
5454
metadata_name_key_to_schema : Required (dict) - Dictionary where {key=metadata_field_name_key : value=metadata_schema_id}
5555
metadata_schema_to_name_key : Required (dict) - Inverse of metadata_name_key_to_schema
56-
divider : Optional (str) - String delimiter to separate metadata field names from their metadata answer options in your metadata_name_key_to_schema dictionary
56+
divider : Optional (str) - String delimiter for all name keys generated
5757
Returns:
5858
Two items - the global_key, and a dictionary with "row_data", "global_key", "external_id" and "metadata_fields" keys
5959
"""

0 commit comments

Comments
 (0)