TJaniF opened a new issue, #48552:
URL: https://github.com/apache/airflow/issues/48552
### Apache Airflow version
3.0.0
### If "Other Airflow 2 version" selected, which one?
main
### What happened?
Added a dag that includes `-> bool | None:` in a function and got an import
error. This dag serializes and runs without issue in Airflow 2.10.
dag to reproduce:
```
from airflow.decorators import dag, task
def _my_func() -> bool | None:
print("Hello")
return None
@dag()
def testdag():
@task
def my_task():
_my_func()
my_task()
testdag()
```
Error:
```
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 228, in
_call_with_frames_removed
File "/files/dags/test.py", line 4, in <module>
def commit_message_checker() -> bool | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
```
Runs in 2.10

Erros in 3.0.0

### What you think should happen instead?
The dag should serialize and run, otherwise this would be a breaking change
necessitating code edits for people upgrading.
### How to reproduce
Add the dag above to the Airflow env. Run `airflow dags reserialize`. See
the error.
### Operating System
MacOS
### Versions of Apache Airflow Providers
None
### Deployment
Other
### Deployment details
breeze
### 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]