Dev-iL commented on code in PR #57942:
URL: https://github.com/apache/airflow/pull/57942#discussion_r2498979880


##########
airflow-core/tests/unit/models/test_taskinstance.py:
##########
@@ -1685,7 +1685,9 @@ def _write2_post_execute(context, _):
         for ti in dr.get_task_instances(session=session):
             ti.run(session=session)
 
-        events = dict(iter(session.execute(select(AssetEvent.source_task_id, 
AssetEvent))))
+        events = dict(
+            (row[0], row[1]) for row in 
session.execute(select(AssetEvent.source_task_id, AssetEvent))

Review Comment:
   Perhaps the below is safer? Consider a scenario where the produced row has 
more than 2 elements for some reason, the test will not capture that because we 
only look at the first two. If on the other hand we convert the entire row, the 
test would fail, as it should.
   
   ```suggestion
               (tuple(row)) for row in 
session.execute(select(AssetEvent.source_task_id, AssetEvent))
   ```



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