Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/overture-schema-pyspark/changelog.d/659.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Moved `pyspark` from a hard dependency to the `spark` optional extra, so installing `overture-schema-pyspark` no longer resolves `pyspark` on runtimes (Glue, EMR) that already bundle their own. Standalone environments need `pip install overture-schema-pyspark[spark]`. Importing the package without PySpark installed now raises an actionable `ModuleNotFoundError` pointing at that extra, instead of a bare "No module named 'pyspark'".
4 changes: 3 additions & 1 deletion packages/overture-schema-pyspark/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ build-backend = "uv_build"
dependencies = [
"click>=8.0",
"overture-schema-system>=0.1.1",
"pyspark>=3.4",
]
description = "PySpark validation expressions for Overture Maps data"
license = "MIT"
name = "overture-schema-pyspark"
requires-python = ">=3.10"
version = "0.1.1"

[project.optional-dependencies]
spark = ["pyspark>=3.4"]

Comment thread
Rachmanin0xFF marked this conversation as resolved.
[project.scripts]
overture-validate = "overture.schema.pyspark.cli:validate_cli"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
"""PySpark validation expressions for Overture Maps data."""

# pyspark is an optional extra (the `spark` extra): a bare install lets this
# package's console script and metadata resolve, but every submodule needs
# pyspark to do anything. Guard the import directly so a missing pyspark gives
# an actionable message; anything else this package imports surfaces its own
# error through the real imports below.
try:
import pyspark # noqa: F401
except ModuleNotFoundError as e:
Comment thread
Rachmanin0xFF marked this conversation as resolved.
raise ModuleNotFoundError(
"overture-schema-pyspark requires PySpark, which isn't installed. "
"Install it with `pip install overture-schema-pyspark[spark]`, or run "
"in an environment that already provides PySpark (e.g. a Spark cluster)."
) from e

from .check import Check, CheckShape
from .schema_check import SchemaMismatch, compare_schemas
from .validate import (
Expand Down
11 changes: 8 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading