Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better mixed Java/Python error messages for external transforms. #31284

Merged
merged 5 commits into from
May 28, 2024

Conversation

robertwb
Copy link
Contributor


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.

Copy link
Contributor

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

Thanks.

without_java_traceback = s + '\n'
for p in traceback_lines:
without_java_traceback = re.sub(
fr'\n{p}$', '', without_java_traceback, flags=re.M)
Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, this sets every line that matches the pattern within the stack trace to an empty string. Is that correct ?

(probably expand documentation to explain the logic here)

@@ -750,7 +751,7 @@ def expand(self, pvalueish):
with ExternalTransform.service(expansion_service) as service:
response = service.Expand(request)
if response.error:
raise RuntimeError(response.error)
raise RuntimeError(_sanitize_java_traceback(response.error))
Copy link
Contributor

Choose a reason for hiding this comment

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

For transform service, we combine the errors from all expansion service container and return them together. Usually one of them is useful while other is a trivial error (for example, URN not available). Seems like this might result in useful Python errors being deleted in that case ?

private ExpansionApi.ExpansionResponse getAggregatedErrorResponse(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. We don't actually delete anything, just copy the (hopefully) relevent bits to the bottom of the wall of text.

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably let's also add a unit 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.

Added.

@github-actions github-actions bot added the yaml label May 22, 2024
@robertwb
Copy link
Contributor Author

Any more concerns before getting this merged?

Copy link
Contributor

@chamikaramj chamikaramj left a comment

Choose a reason for hiding this comment

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

Thanks. LGTM.

@robertwb robertwb merged commit 305e753 into apache:master May 28, 2024
92 of 93 checks passed
lostluck pushed a commit to lostluck/beam that referenced this pull request Jun 3, 2024
…che#31284)

In particular, Java tracebacks read bottom to top, whereas Python tracebacks read top to bottom, resulting in the actual error message being often sandwiched in the middle of two walls of text.
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.

None yet

2 participants