The GitHub Actions job "Tests AMD" on airflow.git/replace-state-with-dep has 
failed.
Run started by GitHub user kaxil (triggered by kaxil).

Head commit for run:
919c8578cc539ea97fae12b2a0ec23f40cce3eb9 / Kaxil Naik <kaxiln...@gmail.com>
Replace DagBag from global app state to with FastAPI dependency

This change replaces the usage of `app.state.dag_bag` with a proper FastAPI 
dependency
for better dependency injection and testability. The DagBag is now provided 
through
a dependency that can be easily mocked in tests and follows FastAPI best 
practices as mentioned 
[here](https://fastapi.tiangolo.com/reference/fastapi/#fastapi.FastAPI.state:~:text=You%20normally%20wouldn%27t%20use%20this%20in%20FastAPI%2C%20for%20most%20of%20the%20cases%20you%20would%20instead%20use%20FastAPI%20dependencies.).

- Explicit Dependencies: Using `DagBagDep` makes it clear in the function 
signature what each endpoint needs, rather than hiding the dependency in 
app.state.
- Better Testing: Dependencies can be easily mocked (via FastAPI's 
`dependency_overrides`) in tests without modifying app state, making unit 
testing simpler and more reliable.
- Request Isolation: Each request gets its own `DagBag` instance through the 
dependency, preventing any potential state leakage between requests.
- Type Safety: The dependency system provides better type checking and IDE 
support compared to accessing `app.state`.

Report URL: https://github.com/apache/airflow/actions/runs/14915808336

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: jobs-unsubscr...@airflow.apache.org
For additional commands, e-mail: jobs-h...@airflow.apache.org

Reply via email to