steveahnahn commented on code in PR #59733:
URL: https://github.com/apache/airflow/pull/59733#discussion_r2649441468


##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_pools.py:
##########
@@ -990,7 +991,7 @@ def test_update_mask_preserves_other_fields(self, 
test_client, session):
         assert response_data["update"]["success"] == ["pool1"]
 
         # Assert: fetch from DB and check only masked field changed
-        updated_pool = session.query(Pool).filter_by(pool="pool1").one()
+        updated_pool = session.execute(select(Pool).where(Pool.pool == 
"pool1")).scalar_one()

Review Comment:
   We are checking for None value on the fields of updated_pool, however 
updated_pool itself cannot be None which is why the .one() should be translated 
to .execute and .scalar_one() whereas .scalar() will allow None to pass through 
for the updated_pool obj which can cause a false positive error



-- 
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]

Reply via email to