Closed Felix-neko closed 7 months ago
UPD:
If I simply add this two lines
serialized_dag = dill.dumps(dag)
dill.loads(serialized_dag)
to the end of my DAG's code and execute it in PyCharm (on the save virtualenv on which my airflow executor runs) i get the same NameError: name 'timedelta' is not defined
I assume that is might be the same reason as described here: https://github.com/apache/airflow/issues/35307
Good catch @Taragolis :-D I assume the same when I read this.
@Felix-neko Is there a specific reason to pass the full DagRun object into the context? Would it help as workaround to only pass in specific details of the full DagRun? Which details would you need in the DagRun for the execution? (Just thinking about a workaround to un-block you)
@Felix-neko Is there a specific reason to pass the full DagRun object into the context? Would it help as workaround to only pass in specific details of the full DagRun? Which details would you need in the DagRun for the execution? (Just thinking about a workaround to un-block you)
@jscheffl : аlas, yes: we have such reasons. We have many DAGs that use DagRun
, Dag
and TaskInstance
instance as objects, extracting data from them inside operators.
And we have a homemade library that uses airflow and also extracts data from DagRun
and TaskInstance
objects inside operators. This feature is really helpful for us.
Hey, @Felix-neko a lot of time has passed since last activity on this issue. Any chance that you have check it on Airflow 2.8.1 with pendulum 3?
This issue has been automatically marked as stale because it has been open for 14 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.
This issue has been closed because it has not received response from the issue author.
Apache Airflow version
2.7.3
What happened
I have a simple DAG (with render_template_as_native_obj option enabled). I'm trying to pass a {{ dag_run }} to a PythonVirtualenvOperator, but when it starts to execute it fails with NameError: name 'timedelta' is not defined error.
I'm trying to run it on
Python 3.11
,airflow==2.7.3
anddill==0.3.7
.Here's my DAG:
And here's my error:
What you think should happen instead
I think that this
DagRun
variable should be correctly unpickled.How to reproduce
I'm running airflow with simple
airflow standalone
command in my virtualenv shell. I'm using the defaultSequentialExecutor
.Operating System
Ubuntu 22.04
Versions of Apache Airflow Providers
Deployment
Official Apache Airflow Helm Chart
Deployment details
I'm using a Python 3.11 virtualenv. Here's my
pip3 freeze
:Anything else
No response
Are you willing to submit PR?
Code of Conduct