Should Kedro automatically make a schema for me? I...
# questions
g
Should Kedro automatically make a schema for me? I seem to recall using Pandas alone that it would make the schema for me if I specified it.
Copy code
DatasetError: Failed while saving data to data set SQLTableDataSet(load_args={'schema': MRI}, save_args={'if_exists': replace, 'index': False, 'schema': MRI}, table_name=MRI_Completion_Volume_Forecast).
(pyodbc.ProgrammingError) ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]The specified schema name "MRI" either does not exist or you do not have permission to use it. (2760) (SQLExecDirectW)')
d
I seem to recall using Pandas alone that it would make the schema for me if I specified it.
pandas.SQLTableDataset
is a pretty straightforward wrapper around
<http://pd.DataFrame.to|pd.DataFrame.to>_sql
. You can check the implementation in https://github.com/kedro-org/kedro-plugins/blob/kedro-datasets-1.8.0/kedro-datasets/kedro_datasets/pandas/sql_dataset.py#L260. So I'd be surprised if pandas would create the schema for you or not differently than what Kedro is doing.
(Not that I haven't checked the pandas behavior; I'm merely pointing out that the Kedro behavior should be equivalent.)
g
I ended up making the schema in SQL and then it seemed to push the data just fine.