-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Closed
Labels
Description
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:
from airflow.decorators import task
@task
def hello_airflow():
print('hello airflow')
and the test contains
from hello import hello_airflow
def test_hello_airflow():
hello_airflow.__wrapped__()
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?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct