apache / apache/beam

Empty flattens cannot be used as side inputs.

Open
#18,666 0 comments 0 reactions 0 assignees View on GitHub
bug core P3 python
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
205

Description

{{with beam.Pipeline() as p:
main = p | "CM" \>\> beam.Create([])
side1 = p | "C1" \>\> beam.Create([])
side2 = p | "C2" \>\> beam.Create([])
side = (side1, side2) | beam.Flatten()
res = main | beam.Map(lambda x, side: x, beam.pvalue.AsList(side))
}}
results in
{{
File "/Users/robertwb/Work/beam/incubator-beam/sdks/python/apache_beam/runners/direct/evaluation_context.py", line 84, in add_values
assert not view.has_result
}}

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

Contributor guide

Open the contributing guide

Research direction

Reproduce the minimal Python pipeline from the issue, then inspect sdks/python/apache_beam/runners/direct/evaluation_context.py around add_values and the failing assertion. Done means an empty Flatten can be used as an AsList side input without triggering the assertion; the payload names no test file, so add or locate a regression test for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.