apache / apache/beam

datetime.date not working with Distinct()

Open
#21,034 0 comments 0 reactions 0 assignees View on GitHub
bug core P3 python types
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

I was using 2.28.0 and running a standard Distinct on a PColl of datetime.dates without problems.

After upgrading to 2.31.0, I'm getting this error:

TypeError: Unable to deterministically encode '2020-12-02' of type '', please provide a type hint for the input of 'Get the unique dates from prices/Group/GroupByKey' [while running 'Get the unique dates from prices/ToPairs']

Had convert the date to str and back to date after running the Distinct() to preserve the date type. Any clues?

Imported from Jira [BEAM-12717](https://issues.apache.org/jira/browse/BEAM-12717). Original Jira may contain additional context.
Reported by: sketzig.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.