You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to understand the preferred methods of accessing KedroContext attributes for testing purposes after 0.18.0, as I receive a deprecation warning.
Background
As part of managing a kedro project, I like to have tests that check attributes like the pipeline or catalog for coherence to naming conventions, etc. This is typically done via creating a kedro context object as a test fixture and running tests against the objects attributes.
Problem
When I do this currently, I'm presented with a warning about deprecation of accessing these attributes (app name, pipeline, etc) after 0.18.0. What is the preferred approach to accessing these attributes in a future proof way?
The text was updated successfully, but these errors were encountered:
Hi @willashford - we talked about how the Context has become too bloated in this webinar last week, will get back to you on where those specific attributes will live in 0.18.0
Hi @willashford , the majority of the currently deprecated properties can be found in kedro.framework.project or in project metadata in <project_name>/pyproject.toml:
fromkedro.framework.projectimportpipelines, settings# you might need to also import `from kedro.framework.startup import bootstrap_project` and call it for your tests
context.pipeline & context.pipelines - import pipelines and use that instead (or pipelines["__default__"])
context.io - duplicate of context.catalog, which we recommend - 0.18.0 might also see this changed though
context.package_name - is in metadata, which is the one returned by bootstrap_project or by _get_project_metadata - i.e. metadata.package_name
context.CONF_ROOT - import settings and use settings.CONF_ROOT
settings corresponds to your project's settings.py, and pipelines to your pipeline_registry.py and/or pipeline registration hooks.
Introduction
I'm looking to understand the preferred methods of accessing KedroContext attributes for testing purposes after 0.18.0, as I receive a deprecation warning.
Background
As part of managing a kedro project, I like to have tests that check attributes like the pipeline or catalog for coherence to naming conventions, etc. This is typically done via creating a kedro context object as a test fixture and running tests against the objects attributes.
Problem
When I do this currently, I'm presented with a warning about deprecation of accessing these attributes (app name, pipeline, etc) after 0.18.0. What is the preferred approach to accessing these attributes in a future proof way?
The text was updated successfully, but these errors were encountered: