这是indexloc提供的服务,不要输入任何密码
Skip to content

Support overriding defaults.yml based on the directory hierarchy #500

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

tatiana
Copy link
Collaborator

@tatiana tatiana commented Jul 25, 2025

Introduce support to multiple defaults.yaml files, allowing properties to be overridden following the proximity to the YAML DAG definition.

Use predictable merge behaviour where the level closest to the DAG YAML files wins. Keep the default section in-DAG for fine-grained overrides and as a template pattern for scoped DAGs.

  • Added test that confirms defaults.yml not only accepts default_args, but also DAG-level arguments;
  • Allow defaults.yml per folder, and merging it with the nearest one will get more priority;
  • Merge tags from all defaults.yml configurations merged.

Closes: #469

The documentation was added in #504.

There are some open questions:

  • Since default_args_config_path and default_args_config_dict support overriding not only default_args, but also any DAG-level args, we should rename them. I've logged a follow-up ticket: Rename default_args_config_path and default_args_config_dict #505
  • Currently default_args_config_path and default_args_config_dict are exposed to users that leverage DagFactory(...).generate_dags(). If we intend to deprecate this method, should we expose these fields via load_yaml_dags?

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.54%. Comparing base (4b95111) to head (736bb63).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #500      +/-   ##
==========================================
+ Coverage   92.35%   92.54%   +0.18%     
==========================================
  Files          11       11              
  Lines        1099     1140      +41     
==========================================
+ Hits         1015     1055      +40     
- Misses         84       85       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tatiana added a commit that referenced this pull request Jul 25, 2025
@tatiana tatiana changed the title Support overriding defaults.yml arguments using directory hierarchy Support overriding defaults.yml based on the directory hierarchy Jul 25, 2025
@tatiana tatiana marked this pull request as ready for review July 25, 2025 16:44
@tatiana tatiana requested a review from a team as a code owner July 25, 2025 16:44
@tatiana tatiana requested a review from pankajkoti July 25, 2025 16:52
@tatiana tatiana requested a review from pankajastro July 25, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for defaults.yaml files at the global and subdirectory level
2 participants