[SPARK-56765][PYTHON] Suppress pyarrow.compute mypy attr-defined errors#55742
Closed
201573 wants to merge 1 commit into
Closed
[SPARK-56765][PYTHON] Suppress pyarrow.compute mypy attr-defined errors#55742201573 wants to merge 1 commit into
201573 wants to merge 1 commit into
Conversation
Contributor
|
cc @zhengruifeng as discussed offline, the daily test failures on branch-4.x/branch-4.2/branch-4.1 are likely related to this issue. |
dfb4378 to
6009085
Compare
Contributor
|
I think the solution in #55744 is better. We should try to avoid ignoring |
Contributor
|
+1, agree with @gaogaotiantian |
Author
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.
What changes were proposed in this pull request?
This PR adds narrow
# type: ignore[attr-defined]annotations forpyarrow.computecalls whose symbols are missing from the PyArrow 24.0.0 stubs:floor_temporal,assume_timezone, andlocal_timestamp.Why are the changes needed?
PyArrow 24.0.0 still exposes these compute kernels at runtime, but its type stubs do not expose them to mypy. This currently breaks PySpark lint with
attr-definederrors.Does this PR introduce any user-facing change?
No.
How was this patch tested?
PYTHON_EXECUTABLE=/tmp/spark-56765-mypy-venv/bin/python ./dev/lint-python --compile/tmp/spark-56765-mypy-venv/bin/ruff format --check python/pyspark/sql/pandas/types.py python/pyspark/sql/conversion.pygit diff --checkpyarrow==24.0.0confirmed thesepyarrow.computeattr-definederrors are suppressed.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-5)