ddeepwel opened a new issue, #23688:
URL: https://github.com/apache/airflow/issues/23688

   ### 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
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to