Code generation mishandles set, variable-length tuple, and Sequence collection types
Maintainers usually reply within 1 day
@sethfitz is already working on this.
Since Jul 22, 2026.
Assessment
This issue has not been assessed yet.
Description
Reported by @vcschapp during review of #518.
The code generator "supports" several collection types that Pydantic accepts, but the generated output is wrong for both the Markdown and PySpark targets. No Overture model uses these types today, so this does not block current work -- filing for later.
Affected annotations:
set, e.g.set[str]- variable-length tuples (list-equivalent), e.g.
tuple[str, ...] Sequence, e.g.Sequence[str](Pydantic accepts it)
A bonus case: fixed-length tuples whose element Spark types are all the same base type, e.g. tuple[str, str] or tuple[str, SnakeCaseString].
Current behavior
| Annotation | FieldShape | Spark schema type | Markdown | Correction |
|---|---|---|---|---|
list[str] |
ArrayOf(Primitive('str')) |
ArrayType(StringType()) (correct) |
list<str> (correct) |
N/A |
set[str] |
Primitive('set') |
StringType() (wrong) |
set (wrong) |
Spark array, MD set<str>? |
tuple[str, ...] |
Primitive('tuple') |
StringType() (wrong) |
tuple (wrong) |
Spark array, MD list<str>? |
tuple[str, str, str] |
Primitive('tuple') |
StringType() (wrong) |
tuple (wrong) |
Spark array, MD ??? |
tuple[str, int] |
Primitive('tuple') |
StringType() (wrong) |
tuple (wrong) |
fail codegen |
Sequence[str] |
raises TypeError |
aborts run (wrong) | aborts run (wrong) | Spark array, MD list<str>? |
This is a general code-generation issue (FieldShape extraction), not specific to the PySpark target.
- Dominant language
- Python
- Stars
- 219
- Forks
- 20
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 37
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OvertureMaps/schema
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OvertureMaps/schema#867 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
OvertureMaps/schema#694 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OvertureMaps/schema#693 ·
Maintainers usually reply within 1 day
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OvertureMaps/schema#675 ·
Maintainers usually reply within 1 day
-
[BUG](ci) `main` fails `make check` on unused `type: ignore` commentsPossibly taken @sethfitz claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
OvertureMaps/schema#899 ·
Maintainers usually reply within 1 day
All issues in OvertureMaps/schema
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
auto-reported bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
needs-triage type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
pollen-robotics/reachy_mini_conversation_app#631 ·
Maintainers usually reply within 7 days
-
stix-atlas.json: the same relationship id is used for several different mitigates relationshipsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100