Skip to content

[Python] Remove leftover "### Labels" debug log in the BigQuery source - #40430

Merged
jrmccluskey merged 1 commit into
apache:masterfrom
Ayoubhm07:remove-bigquery-labels-debug-log
Oct 6, 2026
Merged

jrmccluskey merged 1 commit into
apache:masterfrom
Ayoubhm07:remove-bigquery-labels-debug-log

Conversation

@Ayoubhm07

Copy link
Copy Markdown

_CustomBigQueryStorageSource._setup_temporary_dataset logs the dataset labels at warning level, right before passing the same value to create_temporary_dataset :

_LOGGER.warning("### Labels: %s", str(self.bigquery_dataset_labels))

Three things suggest a debug print rather than an intended log line :

  • ### appears in no other logging call under sdks/python/apache_beam, across its 1380 .py files
  • str() is redundant with %s
  • it is the only _LOGGER.warning(...) call in the module, and it reports a value the caller supplied in the first place

git blame puts the line in #15602, which added the BigQuery Read API support in October 2021, and it has not changed since

No test refers to it : the only assertLogs in io/gcp is bigquery_test.py:398, which targets a DEBUG message from bigquery_read_internal on an unrelated path
_LOGGER is still used at nine call sites in the module, so nothing becomes unused

Checked with yapf==0.43.0, the version pinned in tox.ini:294 : no diff

If you would rather keep the value visible, I am happy to demote it to debug instead of removing it


  • Mention the appropriate issue in your description (for example: addresses #123), if applicable.
    • not applicable, no issue filed for a one-line log removal
  • Update CHANGES.md with noteworthy changes.
    • not noteworthy, removing a debug log changes no behaviour and no API
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.
    • one line removed, no ICLA needed

_CustomBigQueryStorageSource._setup_temporary_dataset logged the dataset
labels at warning level, right before passing them to
create_temporary_dataset. The "###" prefix appears in no other logging
call under sdks/python/apache_beam, and str() is redundant with %s, both
of which point at a debug print rather than an intended log line.

The labels come from the user, so the value carries no information the
caller does not already have.

The line dates back to apache#15602 and no test refers to it. _LOGGER is still
used at nine call sites in the module.
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @jrmccluskey for label python.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@jrmccluskey jrmccluskey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jrmccluskey
jrmccluskey merged commit d803b84 into apache:master Oct 6, 2026
89 checks passed
@codecov

codecov Bot commented Oct 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.04%. Comparing base (69bdf5f) to head (283c6c6).
⚠️ Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #40430   +/-   ##
=========================================
  Coverage     59.04%   59.04%           
  Complexity    15624    15624           
=========================================
  Files          2797     2797           
  Lines        280750   280787   +37     
  Branches      12488    12488           
=========================================
+ Hits         165764   165796   +32     
- Misses       108540   108545    +5     
  Partials       6446     6446           
Flag Coverage Δ
python 79.67% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants