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

   When `BigQueryInsertJobOperator` starts, it logs the whole job 
`configuration` dict in a single line. For query jobs this makes the SQL 
essentially unreadable in the task log — the query shows up embedded in the 
dict repr with escaped `\n` sequences:
   
   ```
   Executing: {'query': {'query': 'select *\nfrom table\nwhere condition', 
'useLegacySql': False}}'
   ```
   
   This change logs the SQL on its own log line (reusing the operator's 
existing `sql` property) so newlines render naturally and the query can be read 
— and copy-pasted into the BigQuery console — directly from the log:
   
   ```
   Executing: {'query': {'query': 'select *\nfrom table\nwhere condition', 
'useLegacySql': False}}
   SQL query:
   select *
   from table
   where condition
   ```
   
   This matches how sibling operators already log SQL (e.g. 
`BigQueryCheckOperator`'s `Executing SQL check: %s`), and matters most when 
reading task logs after a failure or when logs are consumed remotely 
(CloudWatch/Stackdriver/grep), where the UI's rendered-template view isn't 
available. It also removes a stray trailing quote in the original log line. For 
non-query job types (load/copy/extract) the behaviour is unchanged.
   
   No test added: the change is log-output-only, and the project testing 
standards discourage asserting on log output.
   
   **Verification performed:**
   
   - All 37 `BigQueryInsertJobOperator` unit tests pass in Breeze; mypy and 
static checks clean.
   - Ran the `example_bigquery_value_check.py` system test end-to-end against a 
real GCP project: the Dag passed (`1 passed in 188s`), and the task log shows 
the new `SQL query:` line rendered as plain text.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Fable 5)
   
   Generated-by: Claude Code (Fable 5) 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