Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Add support for Kedro Dataset factory
Browse files Browse the repository at this point in the history
Signed-off-by: Nok Chan <[email protected]>
  • Loading branch information
noklam committed Nov 21, 2023
1 parent 0309192 commit 1b216aa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
9 changes: 8 additions & 1 deletion kedro_softfail_runner/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,14 @@ def run(
hook_manager = hook_manager or _NullPluginManager()
catalog = catalog.shallow_copy()

unsatisfied = pipeline.inputs() - set(catalog.list())
# Check which datasets used in the pipeline are in the catalog or match
# a pattern in the catalog
registered_ds = [ds for ds in pipeline.data_sets() if ds in catalog]

# Check if there are any input datasets that aren't in the catalog and
# don't match a pattern in the catalog.
unsatisfied = pipeline.inputs() - set(registered_ds)

if unsatisfied:
raise ValueError(
f"Pipeline input(s) {unsatisfied} not found in the DataCatalog"
Expand Down
13 changes: 12 additions & 1 deletion nbs/00_core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,14 @@
" hook_manager = hook_manager or _NullPluginManager()\n",
" catalog = catalog.shallow_copy()\n",
"\n",
" unsatisfied = pipeline.inputs() - set(catalog.list())\n",
" # Check which datasets used in the pipeline are in the catalog or match\n",
" # a pattern in the catalog\n",
" registered_ds = [ds for ds in pipeline.data_sets() if ds in catalog]\n",
"\n",
" # Check if there are any input datasets that aren't in the catalog and\n",
" # don't match a pattern in the catalog.\n",
" unsatisfied = pipeline.inputs() - set(registered_ds)\n",
" \n",
" if unsatisfied:\n",
" raise ValueError(\n",
" f\"Pipeline input(s) {unsatisfied} not found in the DataCatalog\"\n",
Expand Down Expand Up @@ -234,6 +241,10 @@
"display_name": "python3",
"language": "python",
"name": "python3"
},
"language_info": {
"name": "python",
"version": "3.8.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 1b216aa

Please sign in to comment.