-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Passing a DagRun to a PythonVirtualenvOperator gives NameError: name 'timedelta' is not defined #35483
Comments
UPD: If I simply add this two lines
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 |
I assume that is might be the same reason as described here: #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) |
@jscheffl : аlas, yes: we have such reasons. We have many DAGs that use And we have a homemade library that uses airflow and also extracts data from |
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 default
SequentialExecutor
.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
The text was updated successfully, but these errors were encountered: