dabla opened a new pull request, #77778:
URL: https://github.com/apache/airflow/pull/77778

   `SQLInsertRowsOperator.execute` logs the column names before it runs the 
`preoperator`. `column_names` is a property that queries the database when no 
`columns` are given, and the arguments of the debug call are evaluated whatever 
the log level, so the lookup always runs first and its result is cached.
   
   Two consequences when `columns` is not passed:
   
   - a `preoperator` that creates the table cannot work: the lookup runs 
against a table that does not exist yet;
   - a `preoperator` that alters the table is ignored for the insert: 
`target_fields` holds the columns from before the change.
   
   This moves the debug line below the `preoperator`, so the columns are read 
from the table the rows are inserted into. `_insert_rows` already reads 
`column_names` itself; nothing else relied on the early lookup.
   
   The new test checks the order of the calls on the hook and fails on main.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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