Skip to content

[Feature Request]: Improve failure message when passing Pipeline object / PBegin objects #34703

@hjtran

Description

@hjtran

What would you like to happen?

The failure message for passing a pipeline object to a transform that expects a PCollection doesn't point a user to the underlying issue at all


  with beam.Pipeline() as pipeline:
    _ = (
        pipeline
        | beam.Map(print))

Results in:

...
 File "/usr/local/lib/python3.10/site-packages/apache_beam/runners/pipeline_context.py", line 95, in get_id
    self._id_to_proto[id] = obj.to_runner_api(self._pipeline_context)
  File "/usr/local/lib/python3.10/site-packages/apache_beam/pvalue.py", line 187, in to_runner_api
    self.windowing))
  File "/usr/local/lib/python3.10/site-packages/apache_beam/pvalue.py", line 158, in windowing
    self._windowing = self.producer.transform.get_windowing(
  File "/usr/local/lib/python3.10/site-packages/apache_beam/transforms/ptransform.py", line 563, in get_windowing
    return inputs[0].windowing
AttributeError: 'PBegin' object has no attribute 'windowing'

Issue Priority

Priority: 2 (default / most feature requests 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

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions