MCPcopy
hub / github.com/StructuredLabs/preswald / get_df

Function get_df

preswald/interfaces/data.py:39–50  ·  view source on GitHub ↗

Get a dataframe from the named data source from preswald.toml If the source is a database/has multiple tables, you must specify a table_name

(source_name: str, table_name: str | None = None)

Source from the content-addressed store, hash-verified

37
38
39def get_df(source_name: str, table_name: str | None = None) -> pd.DataFrame:
40 """
41 Get a dataframe from the named data source from preswald.toml
42 If the source is a database/has multiple tables, you must specify a table_name
43 """
44 try:
45 service = PreswaldService.get_instance()
46 df_result = service.data_manager.get_df(source_name, table_name)
47 logger.info(f"Successfully got a dataframe from data source: {source_name}")
48 return df_result
49 except Exception as e:
50 logger.error(f"Error getting a dataframe from data source: {e}")

Callers 6

load_dataFunction · 0.90
demo_load_dataFunction · 0.90
hello.pyFile · 0.90
hello.pyFile · 0.90
hello.pyFile · 0.90
hello.pyFile · 0.90

Calls 2

get_dfMethod · 0.80
get_instanceMethod · 0.45

Tested by

no test coverage detected