stemflow.lazyloading.open_db_connection
open_both_Xy_db_connection(X_train, y_train, duckdb_config)
Open a DuckDB connection. With one source (X_train), behaves like before and yields (X_obj, con). With two sources (X_train, Y_train), yields (X_rel_or_df, Y_rel_or_df, con) sharing the SAME connection.
Source code in stemflow/lazyloading/open_db_connection.py
open_db_connection(X_train, duckdb_config)
open the connection to databse using duckdb
Parameters:
-
X_train–Training variables. Can be either a pd.DataFrame object or a string that indicate the path to the database (.duckdb or .parquet).
-
self–The AdaSTEM/STEM model instance
return
The name of the table in the open connection to the dataframe