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

Commit f0c054a

Browse files
Update connector.py
1 parent dd85321 commit f0c054a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

labelpandas/connector.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from labelbox import Client
2+
from labelbase import Client as baseClient
23
import pandas
34

4-
def create_upload_dict(df:pandas.core.frame.DataFrame, local_files:bool, lb_client:Client, row_data_col:str,
5+
def create_upload_dict(df:pandas.core.frame.DataFrame, local_files:bool, lb_client:Client, base_client:baseClient, row_data_col:str,
56
global_key_col:str="", external_id_col:str="", metadata_index:dict={}, divider:str="///"):
67
""" Multithreads over a Pandas DataFrame, calling create_data_rows() on each row to return an upload dictionary
78
Args:
89
df : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
910
local_files : Required (bool) - If True, will create urls for local files / If False, treats the values in `row_data_col` as urls
1011
lb_client : Required (labelbox.client.Client) - Labelbox Client object
12+
base_client : Required (labelbase.client.Client) - Labelbase Client object
1113
row_data_col : Required (str) - Column name where the data row row data URL is located
1214
global_key_col : Optional (str) - Column name where the data row global key is located - defaults to the row_data_col
1315
external_id_col : Optional (str) - Column name where the data row external ID is located - defaults to the global_key_col
@@ -18,8 +20,8 @@ def create_upload_dict(df:pandas.core.frame.DataFrame, local_files:bool, lb_clie
1820
"""
1921
global_key_col = global_key_col if global_key_col else row_data_col
2022
external_id_col = external_id_col if external_id_col else global_key_col
21-
metadata_schema_to_name_key = get_metadata_schema_to_name_key(lb_mdo=False, divider=divider, invert=False)
22-
metadata_name_key_to_schema = get_metadata_schema_to_name_key(lb_mdo=False, divider=divider, invert=True)
23+
metadata_schema_to_name_key = base_client.get_metadata_schema_to_name_key(lb_mdo=False, divider=divider, invert=False)
24+
metadata_name_key_to_schema = base_client.get_metadata_schema_to_name_key(lb_mdo=False, divider=divider, invert=True)
2325
global_key_to_upload_dict = {}
2426
futures = []
2527
with ThreadPoolExecutor() as exc:

0 commit comments

Comments
 (0)