This is an automated email from the ASF dual-hosted git repository.

ruifengz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 06468a85a7ea [SPARK-54925][PYTHON][FOLLOWUP] Ignore missing import for 
pystack
06468a85a7ea is described below

commit 06468a85a7ea6d8ffaf5d5d04450f46fb56cf849
Author: Tian Gao <[email protected]>
AuthorDate: Wed Jan 21 17:13:17 2026 +0800

    [SPARK-54925][PYTHON][FOLLOWUP] Ignore missing import for pystack
    
    ### What changes were proposed in this pull request?
    
    Add `pystack` to the mypy import missing ignore list.
    
    ### Why are the changes needed?
    
    All the 3rd party libraries were done this way. Current way mypy fails if 
`pystack` exists (unused ignore).
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    mypy passed with and without `pystack`.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #53871 from gaogaotiantian/fix-pystack-typehint.
    
    Authored-by: Tian Gao <[email protected]>
    Signed-off-by: Ruifeng Zheng <[email protected]>
---
 python/mypy.ini              | 3 +++
 python/pyspark/threaddump.py | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/python/mypy.ini b/python/mypy.ini
index 4dd626cd5077..3ae33e085b35 100644
--- a/python/mypy.ini
+++ b/python/mypy.ini
@@ -161,6 +161,9 @@ ignore_missing_imports = True
 [mypy-psutil.*]
 ignore_missing_imports = True
 
+[mypy-pystack.*]
+ignore_missing_imports = True
+
 [mypy-matplotlib.*]
 ignore_missing_imports = True
 
diff --git a/python/pyspark/threaddump.py b/python/pyspark/threaddump.py
index 715395540bcc..93646fd6bf7e 100644
--- a/python/pyspark/threaddump.py
+++ b/python/pyspark/threaddump.py
@@ -28,7 +28,7 @@ def build_parser() -> argparse.ArgumentParser:
 def main() -> int:
     try:
         import psutil
-        from pystack.__main__ import main as pystack_main  # type: ignore
+        from pystack.__main__ import main as pystack_main
     except ImportError:
         print("pystack and psutil are not installed")
         return 5


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to