Skip to content

Validation registry empty when overture-schema-pyspark loaded via zipimport #661

Description

Type

Bug

Scope

Multi-theme or Platform

Skillset

engineering

Description

What: overture.schema.pyspark._registry.REGISTRY comes back empty on AWS Glue. Every feature type then silently reports as unregistered and the task erroneously succeeds 🫠

Why: _registry.py discovers generated modules by walking the expressions/generated/ PEP 420 namespace package with pathlib.Path(root_path).rglob("*.py"), which works... only when a real filesystem directory exists! When the package is added to sys.path as a raw .whl (as Glue does in data-platform when we call it with --extra-py-files), the namespace package's __path__ portions point inside the zip archive, and pathlib can't traverse into one, so the walk silently returns nothing.

Constraints: importlib.resources.files() looks like the obvious fix (its Traversable API is meant to be zipimport-aware), but its MultiplexedPath implementation (at least through Python 3.10) raises NotADirectoryError the moment any namespace portion isn't a real directory -- confirmed by testing it directly against a zip-imported wheel. It can't be used here as-is.

Acceptance criteria:

  • REGISTRY populates correctly whether overture-schema-pyspark is installed normally (real directory) or loaded via zipimport (raw wheel on sys.path).
  • The documented behavior for a missing expressions/generated/ subtree (empty registry, no crash) is unchanged.
  • No regression in the existing overture-schema-pyspark test suite.

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions