fix(typing): make ty suppressions valid with and without the spark extra - #13
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CI's lint leg installs
--extra spark; a plainuv syncdoes not. The two configurations demand oppositety: ignorecomments, so whichever set is unnecessary gets reported as an unused directive. Silencingunused-ignore-commentlets both coexist.Verified locally without the extra:
ruff check,ruff format --check,ty check ., andpytest(462 passed) all pass. The with-extra configuration is exactly what this PR exists to validate — that leg is what went red onmainat f90486e.Does not re-broaden
unresolved-importdetection, which an earlier review found had been globally disabled.🤖 Generated with Claude Code
https://claude.ai/code/session_01JLHEUQXVCvSoisScyEXd7H