-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
_TaskDecorator has no __wrapped__ attribute in v2.3.0 #23688
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
Unfortunately the decorator using |
I would be happy to work on this, but I don't really know where to begin. |
Simply search in
The first class adds the actual property (so you can access this in tests), while the other declares the interface. The second one is not strictly necessary, but it’s good to provide it for editor autocompletion and stuff. |
@uranusjr @ddeepwel do you mind if i create a PR for this? |
Go ahead |
Apache Airflow version
2.3.0 (latest released)
What happened
I run a unit test on a task which is defined using the task decorator. In the unit test, I unwrap the task decorator with the
__wrapped__
attribute, but this no longer works in v2.3.0. It works in v2.2.5.What you think should happen instead
I expect the wrapped function to be returned. This was what occurred in v2.2.5
When running pytest on the airflow v2.3.0 the following error is thrown:
AttributeError: '_TaskDecorator' object has no attribute '__wrapped__'
How to reproduce
Here's a rough outline of the code.
A module
hello.py
contains the task definition:and the test contains
Then run pytest
Operating System
Rocky Linux 8.5 (Green Obsidian)
Versions of Apache Airflow Providers
No response
Deployment
Virtualenv installation
Deployment details
No response
Anything else
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: