OvertureMaps / OvertureMaps/schema

Code generation mishandles set, variable-length tuple, and Sequence collection types

Open
#568 0 comments 0 reactions 1 assignee View on GitHub

@sethfitz is already working on this.

Since Jul 22, 2026.

Dominant language
Python
Stars
213
Forks
22
Avg merge
3d 3h
Merged PRs (30d)
31

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:

  1. set, e.g. set[str]
  2. variable-length tuples (list-equivalent), e.g. tuple[str, ...]
  3. 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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.