You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "atheendre130505 (via GitHub)" <gi...@apache.org> on 2026/02/12 07:03:22 UTC
[I] [Bug]: Beam YAML 'Create' transform crashes on mixed primitive and dictionary elements due to schema inconsistency [beam]
atheendre130505 opened a new issue, #37577:
URL: https://github.com/apache/beam/issues/37577
### What happened?
What happened? Description: The Create transform in Beam YAML crashes with an AttributeError when the input elements list contains a mix of primitive types (int, str) and dictionary mappings.
YamlProviders.create wraps primitives in a Row with a field named element, but it converts dictionaries into Row objects using the dict keys. Because Beam's
Create transform infers the PCollection schema from the very first element, any subsequent element with a different structure causing a serialization crash because the coder cannot find the expected attributes.
Beam Version: 2.61.0 (Python SDK)
python
```
from apache_beam.yaml.yaml_provider import YamlProviders
import apache_beam as beam
with beam.Pipeline() as p:
# A mix of a primitive (Row(element=1)) and a dict (Row(a=2))
p | YamlProviders.create([1, {"a": 2}])
```
Resulting Error: AttributeError: 'Row' object has no attribute 'element'
The pipeline fails immediately upon start-up or during construction, rather than unifying the elements into a consistent schema or providing a diagnostic error message.
### Issue Priority
Priority: 2 (default / most bugs should be filed as P2)
### Issue Components
- [x] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [x] 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam YAML 'Create' transform crashes on mixed primitive and dictionary elements due to schema inconsistency [beam]
Posted by "dheeraj12347 (via GitHub)" <gi...@apache.org>.
dheeraj12347 commented on issue #37577:
URL: https://github.com/apache/beam/issues/37577#issuecomment-3889264933
Hi @atheendre130505,
I'd like to take this issue! I've worked with Python SDKs and data serialization in other Apache projects (like Fory), so I'm familiar with the challenges of schema inference and Row object construction.
The description provides a very clear reproduction case. I'll start by investigating apache_beam/yaml/yaml_provider.py to see how we can better unify the schema when YamlProviders.create encounters mixed types, perhaps by enforcing a consistent wrapper or improving the diagnostic error.
Please assign this to me, and I'll work on a fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug]: Beam YAML 'Create' transform crashes on mixed primitive and dictionary elements due to schema inconsistency [beam]
Posted by "tvalentyn (via GitHub)" <gi...@apache.org>.
tvalentyn closed issue #37577: [Bug]: Beam YAML 'Create' transform crashes on mixed primitive and dictionary elements due to schema inconsistency
URL: https://github.com/apache/beam/issues/37577
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org