Skip to content

fix(typing): make ty suppressions valid with and without the spark extra - #13

Merged
beallio merged 1 commit into
devfrom
fix/ty-optional-spark-suppressions
Aug 4, 2026
Merged

fix(typing): make ty suppressions valid with and without the spark extra#13
beallio merged 1 commit into
devfrom
fix/ty-optional-spark-suppressions

Conversation

@beallio

@beallio beallio commented Aug 4, 2026

Copy link
Copy Markdown
Owner

CI's lint leg installs --extra spark; a plain uv sync does not. The two configurations demand opposite ty: ignore comments, so whichever set is unnecessary gets reported as an unused directive. Silencing unused-ignore-comment lets both coexist.

Verified locally without the extra: ruff check, ruff format --check, ty check ., and pytest (462 passed) all pass. The with-extra configuration is exactly what this PR exists to validate — that leg is what went red on main at f90486e.

Does not re-broaden unresolved-import detection, which an earlier review found had been globally disabled.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JLHEUQXVCvSoisScyEXd7H

CI's lint leg installs `--extra spark`; a plain `uv sync` does not. The two
configurations need opposite suppressions:

- without pyspark, `from pyspark.sql import ...` is unresolved-import;
- with pyspark, that import resolves but `SparkSession.builder` does not, because
  pyspark declares it as a classproperty ty cannot follow, giving
  unresolved-attribute instead.

Whichever set is not needed is then reported as an unused directive, so no
arrangement of ignore comments alone satisfies both environments. Silence
unused-ignore-comment and carry both suppressions.

This does not re-broaden unresolved-import detection, which an earlier review
found had been globally disabled; that rule remains active.

Verified locally without the extra: ruff check, ruff format --check, ty check .,
and pytest all pass. The with-extra configuration is verified by CI's lint leg,
which is what caught this.
@beallio
beallio merged commit d610d1c into dev Aug 4, 2026
9 checks passed
beallio added a commit that referenced this pull request Aug 4, 2026
… extra

Fixes the lint leg that failed on f90486e. CI verified green on PR #13 across all
nine checks, including the --extra spark lint leg that could not be reproduced
locally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant