Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace misspelt TemplateConfigLoader references #2450

Merged
merged 2 commits into from
Mar 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/kedro_project_setup/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Under the hood, `TemplatedConfigLoader` uses [`JMESPath` syntax](https://github.

### Jinja2 support

From version 0.17.0, `TemplateConfigLoader` also supports the [Jinja2](https://palletsprojects.com/p/jinja/) template engine alongside the original template syntax. Below is an example of a `catalog.yml` file that uses both features:
From version 0.17.0, `TemplatedConfigLoader` also supports the [Jinja2](https://palletsprojects.com/p/jinja/) template engine alongside the original template syntax. Below is an example of a `catalog.yml` file that uses both features:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sharing this because we're not using this feature more widely in our docs:

Suggested change
From version 0.17.0, `TemplatedConfigLoader` also supports the [Jinja2](https://palletsprojects.com/p/jinja/) template engine alongside the original template syntax. Below is an example of a `catalog.yml` file that uses both features:
From version 0.17.0, {class}`~kedro.config.TemplatedConfigLoader` also supports the [Jinja2](https://palletsprojects.com/p/jinja/) template engine alongside the original template syntax. Below is an example of a `catalog.yml` file that uses both features:

This is clearly longer and more cumbersome to type, but generates a cross-reference to the TemplatedConfigLoader documentation, and emits a warning in case of a typo.

(I haven't tested this locally because emmmm I'm having some problems building the docs locally, working on it)

(In docstrings this is not needed, because these references are expanded automatically as long as they're wrapped in backquotes)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all the objects in the intersphinx objects inventory that can be referenced from inside or outside the docs https://webknjaz.github.io/intersphinx-untangled/docs.kedro.org/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@astrojuanlu Sorry, I saw this comment but didn't get a chance to test it either. But I trust your knowledge of doc building/am on board, if want to do this still in another PR. :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current state of our docs is... bad, so let's revisit this after I close #2454


```
{% for speed in ['fast', 'slow'] %}
Expand All @@ -271,11 +271,11 @@ From version 0.17.0, `TemplateConfigLoader` also supports the [Jinja2](https://p
{% endfor %}
```

When parsing this configuration file, `TemplateConfigLoader` will:
When parsing this configuration file, `TemplatedConfigLoader` will:

1. Read the `catalog.yml` and compile it using Jinja2
2. Use a YAML parser to parse the compiled config into a Python dictionary
3. Expand `${bucket_name}` in `filepath` using the `globals_pattern` and `globals_dict` arguments for the `TemplateConfigLoader` instance, as in the previous examples
3. Expand `${bucket_name}` in `filepath` using the `globals_pattern` and `globals_dict` arguments for the `TemplatedConfigLoader` instance, as in the previous examples

The output Python dictionary will look as follows:

Expand Down