You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Prab-27 (via GitHub)" <gi...@apache.org> on 2025/12/16 12:28:27 UTC
Re: [PR] Update multiple test files to remove SQLAlchemy query usage [airflow]
Prab-27 commented on code in PR #59501:
URL: https://github.com/apache/airflow/pull/59501#discussion_r2623085539
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py:
##########
@@ -1344,7 +1342,7 @@ def test_should_respond_200(self, test_client, dag_maker, session):
dr = dag_maker.create_dagrun()
ti = dr.task_instances[0]
- asset1_id = session.query(AssetModel.id).filter_by(uri=asset1.uri).scalar()
+ asset1_id = session.scalar(select(AssetModel.id).filter_by(uri=asset1.uri))
Review Comment:
we can also use .where() - it recommended [here ](https://docs.sqlalchemy.org/en/14/core/selectable.html#sqlalchemy.sql.expression.Select.filter_by)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org