Comments (3)
I believe the difference is mainly that you use a non-constant parameter default. If no configuration is given at trigger point of a DAG run (which is the case of scheduled runs) then the defaults are applied. In case of a triggered run the config dict is used and over-rides the defaults.
If you modify the config dict at point of trigger and remove values then also the default will be used, same like if you trigger on API and do not pass a conf.
Main issue I see is if you have non-constant defaults in parameters that defaults are changing based on time of evaluation. At the moment this is a conceptual thing and I would not rate as this being a bug.
If you need to have constant parameters throughout the run of a DAG and your default parameter values are "volatile" then I propose that you capture the params initially in a python task ans return them as response. Then this is persisted as XCom and you could use the XCom from the first task to make downstream logic constant. Otherwise it would be good to step back from using volatile defaults. If you need a date, then maybe better try using logical date from the DAG run or leave the field w/o a default and calculate the required volatile input based on other constant facts.
from airflow.
Thanks for the feedback. We will be implementing a task to persist the values in XCom as a workaround as it's suggested by you as well.
For scheduled run, instead of re-evaluating the default value of DAG params, wouldn't it make it more consistent if it evaluates the params (to constant values) and proceed with task runs?
from airflow.
Yes, there was a bit of discussion in the community about changing the (previous, you could rate it "legacy") conf
that is merged with the later introduced "params" but no decision was made. It might be something that could be made cleaner in an Airflow 3 I assume.
@hussein-awala made an attempt in a PR (see #29174) to clean this up... but somehow it never made it.
In general persisting the params at point of start sounds reasonable but might be treated as a breaking change, I assume a lot of users on the contrary rely on an option to dynamically evaluate. If this behavior is to be changed, at least there would be an option needed to change to previous logic for backwards compatibility.
I'll put the request as a discussion item into a future Airflow 3.0 list.
from airflow.
Related Issues (20)
- values.yaml `dags.gitSync.containerLifecycleHooks` Does not working HOT 2
- Improve SFTPOperator with directory transfer and DELETE operation HOT 7
- add ower to TaskInstance class HOT 1
- Status of testing Providers that were prepared on June 22, 2024 HOT 38
- openlineage: Non-local executor's initializer breaking the Airflow DB connection HOT 6
- ODBC Provider Configuration
- admin canot see admin components HOT 2
- Azure Datalake Storage V2 ObjectStoragePath connection issues HOT 1
- PythonVirtualOperator fails silently when virtualenv is not installed. HOT 12
- RedshiftDataOperator fails when `return_sql_result` is true, and SQL statements are provided HOT 7
- ElasticsearchSQLHook fails with AttributeError: __enter__ HOT 6
- Airflow log cannot be displayed on logs page HOT 9
- ProcessingJobName is not preserved after execution returns from deferred state in SM proceesing job HOT 1
- deferred tasks get kill during heartbeat callback in some rare cases HOT 6
- Enhance Variable.set to create versions in GCP Secret Manager when backend is connected
- Task processes killed with SIGTERM signal - task PID of job runner does not match
- Add task status filters to Task Duration Histogram view HOT 1
- Deferred operator do not preserve attribute values set during execution HOT 1
- Missing `usePgbouncer` key for Triggerer
- Logging out from Web UI raises Airflow 405 error HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from airflow.