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

Commit 14fc817

Browse files
Update connector.py
1 parent 12197b7 commit 14fc817

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

labelpandas/connector.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,41 +190,46 @@ def create_data_rows(client:labelboxClient, row:pandas.core.series.Series,
190190
return_value["data_row"]["global_key"] = str(row[global_key_col])
191191
return return_value
192192

193-
def get_columns_function(table:pandas.core.frame.DataFrame):
193+
def get_columns_function(table:pandas.core.frame.DataFrame, extra_client=None):
194194
"""Grabs all column names from a Pandas DataFrame
195195
Args:
196196
table : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
197+
extra_client : Ignore this value - necessary for other labelbase integrations
197198
Returns:
198199
List of strings corresponding to all column names
199200
"""
200201
return [col for col in table.columns]
201202

202-
def get_unique_values_function(table:pandas.core.frame.DataFrame, column_name:str):
203+
def get_unique_values_function(table:pandas.core.frame.DataFrame, column_name:str, extra_client=None):
203204
"""Grabs all unique values from a column in a Pandas DataFrame
204205
Args:
205206
table : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
206207
column_name : Required (str) - Column name
208+
extra_client : Ignore this value - necessary for other labelbase integrations
209+
207210
Returns:
208211
List of strings corresponding to all unique values in a column
209212
"""
210213
return list(table[column_name].unique())
211214

212-
def add_column_function(table:pandas.core.frame.DataFrame, column_name:str, default_value=""):
215+
def add_column_function(table:pandas.core.frame.DataFrame, column_name:str, default_value="", extra_client=None):
213216
""" Adds a column of empty values to an existing Pandas DataFrame
214217
Args:
215218
table : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
216219
column_name : Required (str) - Column name
217220
default_value : Optional - Value to insert for every row in the newly created column
221+
extra_client : Ignore this value - necessary for other labelbase integrations
218222
Returns:
219223
Your table with a new column given the column_name and default_value
220224
"""
221225
table[column_name] = default_value
222226
return table
223227

224-
def get_table_length_function(table:pandas.core.frame.DataFrame):
228+
def get_table_length_function(table:pandas.core.frame.DataFrame, extra_client=None):
225229
""" Tells you the size of a Pandas DataFrame
226230
Args:
227231
table : Required (pandas.core.frame.DataFrame) - Pandas DataFrame
232+
extra_client : Ignore this value - necessary for other labelbase integrations
228233
Returns:
229234
The length of your table as an integer
230235
"""

0 commit comments

Comments
 (0)