uranusjr commented on code in PR #22909:
URL: https://github.com/apache/airflow/pull/22909#discussion_r847713698


##########
tests/models/test_dagrun.py:
##########
@@ -1036,14 +1036,17 @@ def 
test_mapped_mixed__literal_not_expanded_at_create(dag_maker, session):
         mapped = MockOperator.partial(task_id='task_2').expand(arg1=literal, 
arg2=XComArg(task))
 
     dr = dag_maker.create_dagrun()
-    indices = (
-        session.query(TI.map_index)
+    query = (
+        session.query(TI.map_index, TI.state)
         .filter_by(task_id=mapped.task_id, dag_id=mapped.dag_id, 
run_id=dr.run_id)
         .order_by(TI.map_index)
-        .all()
     )
 
-    assert indices == [(-1,)]
+    assert query.all() == [(-1, None)]
+
+    # Verify_integrity shouldn't change the result now that the TIs exist
+    dr.verify_integrity()
+    assert query.all() == [(-1, None)]

Review Comment:
   We probably need to do this?
   
   ```suggestion
       # Verify_integrity shouldn't change the result now that the TIs exist
       dr.verify_integrity(session=session)
       session.flush()
       assert query.all() == [(-1, None)]
   ```
   
   Otherwise `verify_integrity` would use a new session, and the query result 
won’t change regardless due to transaction isolation.



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