Skip to content

[Bug]: Direct Runner doesn't use coder registered in registry? #29908

Closed

Description

@hjtran

What happened?

I'm trying to write a coder for an unpicklable object, but when I register it with the coder registry, the direct runner seems to want to try to pickle it anyways. I've created an example in beam playground

Not sure if I'm just missing something trivial here

Issue Priority

Priority: 3 (minor)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Activity

  1. hjtran commented on Jan 3, 2024

    @hjtran
    ContributorAuthor

    Might this be related to #18490

  2. hjtran commented on Jan 4, 2024

    @hjtran
    ContributorAuthor

    #18490 was a red herring. The issue isn't exactly with the python direct runner either. I think the issue is that apache_beam.transforms.util.ReshufflePerKey uses type hints Any and Any data use the picklecoder rather than any specially specified coder in the coder registry.

  3. tvalentyn commented on Jan 29, 2024

    @tvalentyn
    Contributor

    have you tried setting with_output_types / with_input_types explicitly after create or on reshuffle ?

  4. hjtran commented on Jan 29, 2024

    @hjtran
    ContributorAuthor

    Yes, that indeed works. I think the issue is more that when this happens, it's difficult to identify why, especially if you think that the registry coder will get respected all the time.

    I have a limited fix that I haven't gotten around to posting yet that narrows the type definitions in ReshufflePerKey for global windows. This fixes some part of the issue

  5. added this to the 2.64.0 Release milestone on Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions