You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "liaopeiyuan (via GitHub)" <gi...@apache.org> on 2025/01/16 00:45:09 UTC
[PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
liaopeiyuan opened a new pull request, #33614:
URL: https://github.com/apache/beam/pull/33614
`_finalize_write`'s output type is `TimestampedValue`, not `str`, so when `runtime_type_check` is set to `True` in `TypeOptions`, it would raise a `SimpleTypeHintError` with the following details: `apache_beam.typehints.decorators.TypeCheckError: According to type-hint expected output should be of type <class 'str'>. Instead, received '<apache_beam.transforms.window.TimestampedValue object at 0x7a303057cd10>', an instance of type <class 'apache_beam.transforms.window.TimestampedValue'>`
------------------------
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] 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.
- [x] Update `CHANGES.md` with noteworthy changes.
- [x] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more tips on [how to make review process smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit [https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
GitHub Actions Tests Status (on master branch)
------------------------------------------------------------------------------------------------
[](https://github.com/apache/beam/actions?query=workflow%3A%22Build+python+source+distribution+and+wheels%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Python+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Java+Tests%22+branch%3Amaster+event%3Aschedule)
[](https://github.com/apache/beam/actions?query=workflow%3A%22Go+tests%22+branch%3Amaster+event%3Aschedule)
See [CI.md](https://github.com/apache/beam/blob/master/CI.md) for more information about GitHub Actions CI or the [workflows README](https://github.com/apache/beam/blob/master/.github/workflows/README.md) to see a list of phrases to trigger workflows.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2609757844
Thanks @liaopeiyuan
I would create a bug with a reproducible example. Agree with @Abacn that changing the type coercion might not be the best solution here. I am seeing that some logic in type checking machinery that suggests, TimetampedValue instances should be compared by the type they are enveloping: https://github.com/apache/beam/blob/dc7426f9283f763b2fa0f568d71c99e844cc0890/sdks/python/apache_beam/typehints/typecheck.py#L158
I would check why that is not happening.
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "liaopeiyuan (via GitHub)" <gi...@apache.org>.
liaopeiyuan commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2594286682
`assign set of reviewers` (unclear why Prism Python checks are failing)
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2633728949
Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @damccorm for label python.
R: @damondouglas for label io.
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)
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2594281670
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment `assign set of reviewers`
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2762760156
I think we can close it for now due to inactivity and, alternative approach is preferred
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2605802955
Thanks for the fix. There might be something need clarification here. TimestampedValue is a special value type in Beam. If an element wrapped as a TimestampedValue, in downstream the timestamp becomes a metadata for this element, while the element is still the original one, e.g.
```
_ = p | beam.Create(["1", "2", "3"]) | beam.Map(lambda x: window.TimestampedValue(x, timestamp.MAX_TIMESTAMP)) | beam.Map(print)
presult = p.run()
```
it prints the str itself instead of TimestampedValue(1)
Seems this convention conflicts with type check also part of Beam SDK. cc: @jrmccluskey @tvalentyn may have a solution here
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "Abacn (via GitHub)" <gi...@apache.org>.
Abacn closed pull request #33614: Remove type coercion of `FinalizeWrite` in iobase.py
URL: https://github.com/apache/beam/pull/33614
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2627067956
Reminder, please take a look at this pr: @jrmccluskey @Abacn
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2594287719
Assigning reviewers. If you would like to opt out of this review, comment `assign to next reviewer`:
R: @jrmccluskey for label python.
R: @Abacn for label io.
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).
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "chamikaramj (via GitHub)" <gi...@apache.org>.
chamikaramj commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2762099694
Any updates ?
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "derrickaw (via GitHub)" <gi...@apache.org>.
derrickaw commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2731535523
@liaopeiyuan, friendly ping to revisit this PR. Thanks!
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Remove type coercion of `FinalizeWrite` in iobase.py [beam]
Posted by "damccorm (via GitHub)" <gi...@apache.org>.
damccorm commented on PR #33614:
URL: https://github.com/apache/beam/pull/33614#issuecomment-2634223794
waiting on author
--
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org