collinmcnulty opened a new issue, #51018:
URL: https://github.com/apache/airflow/issues/51018
### Apache Airflow version
3.0.1
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
DAG as imported from airflow.sdk does not implement test() even though
airflow.models.DAG does. This means that you can't actually run dag.test.
### What you think should happen instead?
airflow.sdk.DAG should implement test and it should behave the same as
Airflow 2.
### How to reproduce
Here is minimal DAG:
```python
import logging
from pendulum.datetime import DateTime
from airflow.decorators import dag, task
@dag(
schedule=None,
start_date=DateTime.create(2024, 1, 1, tz="UTC"),
)
def minimal_dag():
@task.python
def hello(params) -> str | None:
logging.info("hello")
hello()
minimal = minimal_dag()
if __name__ == "__main__":
minimal.test()
```
And the resulting error
```
Traceback (most recent call last):
File "<omitted>/airflow/dags/example.py", line 28, in <module>
minimal.test()
^^^^^^^^^^^^
AttributeError: 'DAG' object has no attribute 'test'
### Operating System
Mac OS 18.5
### Versions of Apache Airflow Providers
None relevant
### Deployment
Virtualenv installation
### Deployment details
_No response_
### Anything else?
I verified that the same DAGs were working with dag.test on Airflow 2.10.4
### 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]