potiuk commented on issue #25008:
URL: https://github.com/apache/airflow/issues/25008#issuecomment-1182587335

   Ths is not a bug. Simply previous behaviour was an unintended side effect.
   
   via https://airflow.apache.org/docs/apache-airflow/stable/tutorial.html#id2
   
   > Note that the airflow tasks test command runs task instances locally, 
outputs their log to stdout (on screen), does not bother with dependencies, and 
does not communicate state (running, success, failed, …) to the database. It 
simply allows testing a single task instance.
   
   While "Xcom" is not specified here, leaving an XCom behing from `test` 
command is something that falls into that .
   
   In 2.3. Foreign Key was added between XCom and Task Instance - 
https://github.com/apache/airflow/pull/22334 (it was missing before). The 
result of missing foreign key was that the XCom created during the 'test" 
command was never cleaned. 
   
   This piece of code 
https://github.com/apache/airflow/commit/71c980a8ffb3563bf16d8a23a58de54c9e8cf556#diff-ad618185a072910e49c11770954af009d1cc070b120a4fde5f2fc095a588271bR550
 removes the dag run (and thus transitively task instance and xcom) created 
during the tests)
   
   I believe (@uranusjr ? Can you confirm please) this was fully intentional 
change.
    
   Maybe this is a good case however to add the version of `airflow tasks test` 
(`aiflow tasks tests --no-cleanup` ?) command that actually leaves some traces 
behind. WDYT @uranusjr ?
   


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