Skip to content

Commit

Permalink
fix(datasets): mask credentials in ibis dataset when printed (kedro-o…
Browse files Browse the repository at this point in the history
…rg#786)

* mask credentials

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* update describe method

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* release note

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

* linting

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>

---------

Signed-off-by: Nok <nok.lam.chan@quantumblack.com>
Signed-off-by: Merel Theisen <merel.theisen@quantumblack.com>
  • Loading branch information
noklam authored and merelcht committed Aug 27, 2024
1 parent 833d57b commit 1570d0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions kedro-datasets/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@
## Breaking Changes
## Community contributions

# Release 4.0.1
## Major features and improvements
## Bug fixes and other changes
- Updated `ibis.TableDataset` to make sure credentials are not printed in interactive environment.

## Breaking Changes
## Community contributions

# Release 4.0.0
## Major features and improvements

Expand Down
4 changes: 3 additions & 1 deletion kedro-datasets/kedro_datasets/ibis/table_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ def _describe(self) -> dict[str, Any]:
"filepath": self._filepath,
"file_format": self._file_format,
"table_name": self._table_name,
"connection_config": self._connection_config,
"backend": self._connection_config.get("backend")
if self._connection_config
else None,
"load_args": self._load_args,
"save_args": self._save_args,
"materialized": self._materialized,
Expand Down
2 changes: 1 addition & 1 deletion kedro-datasets/kedro_datasets/pandas/json_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def preview(self, nrows: int = 5) -> TablePreview:
dataset_copy = self._copy()
dataset_copy._load_args.setdefault("lines", True) # type: ignore[attr-defined]
dataset_copy._load_args["nrows"] = nrows # type: ignore[attr-defined]
preview_df = dataset_copy._load()
preview_df = dataset_copy._load() # type: ignore

preview_dict = preview_df.to_dict(orient="split")

Expand Down

0 comments on commit 1570d0a

Please sign in to comment.