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

Aperta
#568 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sethfitz ci sta già lavorando.

Dal 22/7/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Python
Stelle
219
Fork
20
Merge medio
1g 21h
PR unite (30g)
37

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OvertureMaps/schema

Tutte le issue di OvertureMaps/schema

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.