Open pedro-cf opened 3 months ago
- Is it a feature suggestion, or a suggestion for improving the documentation?
Please clarify the description - it would also be useful to provide some code examples that will explain the motivation.
- Is this PR a recreation of #40859? Why was the latter closed?
Generally useful and specifically easier access to these variables within operators that have serialization issues with the dag_run and ti objects, such as the PythonVirtualEnvOperator.
- Is it a feature suggestion, or a suggestion for improving the documentation?
Please clarify the description - it would also be useful to provide some code examples that will explain the motivation.
- Is this PR a recreation of Add 'dag_id' and 'dag_run_id' to the default template variables #40859? Why was the latter closed?
- Feature Request/Suggestion. I believe I give a solid reason:
Generally useful and specifically easier access to these variables within operators that have serialization issues with the dag_run and ti objects, such as the PythonVirtualEnvOperator.
- Different variables in this issue.
There's currently an open PR (#41039) for solving #34158. When this PR is merged, will there still be a justification for the suggested feature?
There's currently an open PR (#41039) for solving #34158. When this PR is merged, will there still be a justification for the suggested feature?
I believe so, these are key variables, more important than some of the variables already available. It's also a much cleaner way to access these directly.
I wonder if we should try to add some more, and remove ti
and dag_run
altogether. Exposing those objects directly to the user is kind of problematic.
Or, maybe we should make those a proxy instead of the actual object, and remove things like task_id
and run_id
.
Adding this to 3.0 since I think we need something to track the discussion. I’m not particularly in favour or disfavour to the exact solution proposed here.
Description
Add
dag_id
andmap_index
as default variables to the template variables (accessible via task parameters).Use case/motivation
Generally useful and specifically easier access to these variables within operators that have serialization issues with the
dag_run
andti
objects, such as thePythonVirtualEnvOperator
.Related issues
Are you willing to submit a PR?
Code of Conduct