Skip to content

Conversation

@aIbrahiim
Copy link
Contributor

@aIbrahiim aIbrahiim commented Nov 21, 2025

Fixes: #35198
Successful run: https://github.com/aIbrahiim/beam/actions/runs/19570901663


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@aIbrahiim aIbrahiim marked this pull request as ready for review November 21, 2025 13:25
@aIbrahiim
Copy link
Contributor Author

/assign @damccorm

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@aIbrahiim
Copy link
Contributor Author

aIbrahiim commented Nov 21, 2025

assign set of reviewers @damccorm

@github-actions
Copy link
Contributor

Assigning reviewers:

R: @tvalentyn 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).

table_name: "{BQ_TABLE}"
fields: ['label']
row_restriction_template: "label = '37a'"
row_restriction_template: "label = '{{}}'"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should work as written, so if this is failing then it is probably a real bug which is being covered up. We should address that in the transform itself, not in the test.

Copy link
Contributor

Choose a reason for hiding this comment

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

To be clear - we should not be changing this test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah okay got it, I will revert it and will focus on fixing handler

@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.37%. Comparing base (c8d7ca0) to head (3c3fe2e).
⚠️ Report is 54 commits behind head on master.

Files with missing lines Patch % Lines
...he_beam/transforms/enrichment_handlers/bigquery.py 0.00% 10 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@ ## master #36874 +/- ## ============================================ + Coverage 40.33% 40.37% +0.03%  Complexity 3456 3456 ============================================ Files 1225 1226 +1 Lines 187817 188243 +426 Branches 3586 3586 ============================================ + Hits 75762 76000 +238  - Misses 108665 108853 +188  Partials 3390 3390 
Flag Coverage Δ
python 40.65% <0.00%> (+0.08%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.
@tvalentyn
Copy link
Contributor

assign set of reviewers @damccorm

Drive-by: the syntax for the review command is like so: R: @damccorm

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@aIbrahiim aIbrahiim force-pushed the fix-postcommit-yaml-xlang-direct branch from 1d5649e to 6c0ed7e Compare November 24, 2025 22:32
@aIbrahiim aIbrahiim requested a review from damccorm November 24, 2025 22:34
@tvalentyn
Copy link
Contributor

PTAL at lint and formatter errors.

self.fields = fields if fields else []
self.condition_value_fn = condition_value_fn
self.query_fn = query_fn
self._has_placeholders = '{}' in self.row_restriction_template
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to add a new feature to support {} placeholders

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I will remove the placeholder logic here and will make the handler will try to match by key first, and if there are unmatched requests like hardcoded templates it will pair them with the same result.

@aIbrahiim aIbrahiim force-pushed the fix-postcommit-yaml-xlang-direct branch from abd73a3 to 6d2d881 Compare November 26, 2025 10:56
@aIbrahiim aIbrahiim requested a review from damccorm November 26, 2025 11:02
elements:
- {label: '11a', rank: 0, name: 'S1'}
- {label: '37a', rank: 1, name: 'S2'}
- {label: '389a', rank: 2, name: 'S3'}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we changing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test expectation was incorrect. Before the fix, all inputs got the same result. After the fix, each input correctly matches its table row, so we now expect all 3 enriched rows with correct ranks (0, 1, 2)

Copy link
Collaborator

@shunping shunping Nov 27, 2025

Choose a reason for hiding this comment

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

When I looked at this the other day, I found it is a flaky test.

https://github.com/apache/beam/actions/runs/19349133623/job/55356733649

In the run above, one was successful, while the others were not.

The perm-red started around 11/13, but I did not see any related change there.
#35198 (comment)

Even if we have a fix, we have to run it multiple times to make sure it won't be flaky again.

Copy link
Collaborator

@shunping shunping Nov 27, 2025

Choose a reason for hiding this comment

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

Also, according to the original docstring of row_restriction_template, the line row_restriction_template: "label = '37a'" in the yaml file is supposed to filter the rows. Right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, row_restriction_template: "label = '37a'" should filter. The fix will use it as is so only matching rows get enriched and test expectation should align with this. and I'll run multiple times to verify stability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uploading image.png…

@aIbrahiim aIbrahiim requested a review from shunping November 28, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment