diff --git a/kedro-datasets/RELEASE.md b/kedro-datasets/RELEASE.md index 2ffca13eb..f5569c8ae 100755 --- a/kedro-datasets/RELEASE.md +++ b/kedro-datasets/RELEASE.md @@ -8,9 +8,12 @@ pip install kedro-datasets[pandas-parquetdataset] * Added `NetCDFDataset` for loading and saving `*.nc` files. ## Bug fixes and other changes +* If using MSSQL, `load_args:params` will be typecasted as tuple. + ## Community contributions Many thanks to the following Kedroids for contributing PRs to this release: * [Riley Brady](https://github.com/riley-brady) +* [Andrew Cao](https://github.com/andrewcao1) # Release 2.1.0 diff --git a/kedro-datasets/kedro_datasets/pandas/sql_dataset.py b/kedro-datasets/kedro_datasets/pandas/sql_dataset.py index 24a835f5d..13baf20c3 100644 --- a/kedro-datasets/kedro_datasets/pandas/sql_dataset.py +++ b/kedro-datasets/kedro_datasets/pandas/sql_dataset.py @@ -566,4 +566,4 @@ def adapt_mssql_date_params(self) -> None: except (TypeError, ValueError): new_load_args.append(value) if new_load_args: - self._load_args["params"] = new_load_args + self._load_args["params"] = tuple(new_load_args) diff --git a/kedro-datasets/tests/pandas/test_sql_dataset.py b/kedro-datasets/tests/pandas/test_sql_dataset.py index 669d445e4..08f7ecdda 100644 --- a/kedro-datasets/tests/pandas/test_sql_dataset.py +++ b/kedro-datasets/tests/pandas/test_sql_dataset.py @@ -487,14 +487,16 @@ def test_adapt_mssql_date_params(self, mocker): ds = SQLQueryDataset( sql=SQL_QUERY, credentials={"con": MSSQL_CONNECTION}, load_args=load_args ) - assert ds._load_args["params"] == [ - "2023-01-01T00:00:00", - "2023-01-01T20:26", - "2023", - "test", - 1.0, - 100, - ] + assert ds._load_args["params"] == tuple( + [ + "2023-01-01T00:00:00", + "2023-01-01T20:26", + "2023", + "test", + 1.0, + 100, + ] + ) def test_adapt_mssql_date_params_wrong_input(self, mocker): """Test that the adapt_mssql_date_params