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

[Bug]: python trivial inferencing code fails when dealing with unpacking+generators #33308

Open
1 of 17 tasks
hjtran opened this issue Dec 6, 2024 · 0 comments
Open
1 of 17 tasks

Comments

@hjtran
Copy link
Contributor

hjtran commented Dec 6, 2024

What happened?

The following unit test (you can drop it into trivial_inference_test.py) fails

 def testNestedUnpack(self):
    def nest_in_list(x, y):
      return [(x, y) for _ in range(1)]
    self.assertReturnType(
        typehints.List[typehints.Tuple[str, int]],
        lambda x: nest_in_list(*x), [typehints.Tuple[str, int]])
Expected :List[Tuple[<class 'str'>, <class 'int'>]]
Actual   :List[Tuple[<class 'type'>, <class 'type'>]]

This can cause issues with certain callables. For example:
#33014

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

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: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Samza Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant