apache / beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
https://beam.apache.org/
Apache License 2.0
7.89k stars 4.27k forks source link

numpy.int64 type is not serialized correctly in Python 3.11 and Python 3.12 #33137

Closed liferoad closed 1 week ago

liferoad commented 1 week ago

Fixes #33020 and #33021. Basically, Beam should return TypeError like TypeError: Unable to deterministically encode '2000-01-01' of type '<class 'numpy.datetime64'>', please provide a type hint for the input of 'GroupByKey' [while running 'CreatePInput0/Map(decode)']. The user needs to define their own deterministic coder to use this type as the groupby key.

This is a hacky fix by checking whether __getstate__ returns reasonable results.


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

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.

github-actions[bot] commented 1 week ago

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

github-actions[bot] commented 1 week ago

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

R: @jrmccluskey for label python.

Available commands:

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

liferoad commented 1 week ago

Failed workflows are not related to this PR.