nathadfield commented on issue #60880:
URL: https://github.com/apache/airflow/issues/60880#issuecomment-3789135583
@jedcunningham Thanks very much for this! I can certainly remove this aspect
from the scope but I was wondering if we could only allow versions that exist
in DagBundleModel (versions Airflow has actually seen/refreshed):
e.g.
```python
# In dag_runs.py
if bundle_version and bundle_version != "__LATEST__":
# Validate that this version exists in DagBundleModel
dag_bundle = session.scalars(
select(DagBundleModel).where(DagBundleModel.name == dm.bundle_name)
).one_or_none()
if dag_bundle and dag_bundle.version != bundle_version:
raise HTTPException(
status.HTTP_400_BAD_REQUEST,
detail=f"Bundle version '{bundle_version}' has not been seen by
Airflow"
)
```
--
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]