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

gurwls223 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 4c58ecb872f9 [SPARK-54632][INFRA][FOLLOW-UP] Reenable ruff on our CI 
and lint-python
4c58ecb872f9 is described below

commit 4c58ecb872f9539f15f40e589fd6e32e5cccee98
Author: Tian Gao <[email protected]>
AuthorDate: Fri Dec 12 09:42:46 2025 +0900

    [SPARK-54632][INFRA][FOLLOW-UP] Reenable ruff on our CI and lint-python
    
    ### What changes were proposed in this pull request?
    
    Re-enable #53412 and fix lint.
    
    ### Why are the changes needed?
    
    Same as #53412
    
    ### Does this PR introduce _any_ user-facing change?
    
    No
    
    ### How was this patch tested?
    
    Local ruff test passes
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No
    
    Closes #53441 from gaogaotiantian/reenable-ruff.
    
    Authored-by: Tian Gao <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 dev/lint-python                                                        | 1 +
 dev/spark-test-image/lint/Dockerfile                                   | 1 +
 python/pyspark/sql/pandas/serializers.py                               | 1 -
 python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py             | 2 +-
 python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py           | 2 +-
 .../tests/pandas/test_pandas_udf_typehints_with_future_annotations.py  | 3 ++-
 6 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dev/lint-python b/dev/lint-python
index fab7ad9ebe26..3b64671c5cde 100755
--- a/dev/lint-python
+++ b/dev/lint-python
@@ -79,6 +79,7 @@ if [[ -z 
"$COMPILE_TEST$BLACK_TEST$PYSPARK_CUSTOM_ERRORS_CHECK_TEST$FLAKE8_TEST$
   BLACK_TEST=true
   PYSPARK_CUSTOM_ERRORS_CHECK_TEST=true
   FLAKE8_TEST=true
+  RUFF_TEST=true
   MYPY_TEST=true
   MYPY_EXAMPLES_TEST=true
   MYPY_DATA_TEST=true
diff --git a/dev/spark-test-image/lint/Dockerfile 
b/dev/spark-test-image/lint/Dockerfile
index 6ab571bf35d6..4984f56fc763 100644
--- a/dev/spark-test-image/lint/Dockerfile
+++ b/dev/spark-test-image/lint/Dockerfile
@@ -80,6 +80,7 @@ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
 RUN python3.11 -m pip install \
     'black==23.12.1' \
     'flake8==3.9.0' \
+    'ruff==0.14.8' \
     'googleapis-common-protos-stubs==2.2.0' \
     'grpc-stubs==1.24.11' \
     'grpcio-status==1.76.0' \
diff --git a/python/pyspark/sql/pandas/serializers.py 
b/python/pyspark/sql/pandas/serializers.py
index f7597c3bdafa..6a96aa3d2bf2 100644
--- a/python/pyspark/sql/pandas/serializers.py
+++ b/python/pyspark/sql/pandas/serializers.py
@@ -1216,7 +1216,6 @@ class 
GroupPandasUDFSerializer(ArrowStreamPandasUDFSerializer):
         Each outer iterator element represents a group, containing an iterator 
of Series lists
         (one list per batch).
         """
-        import pyarrow as pa
 
         def process_group(batches: "Iterator[pa.RecordBatch]"):
             # Convert each Arrow batch to pandas Series list on-demand, 
yielding one list per batch
diff --git a/python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py 
b/python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py
index a117a049952c..5136cadf7ab8 100644
--- a/python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py
+++ b/python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py
@@ -461,7 +461,7 @@ class ArrowUDFTypeHintsTests(ReusedSQLTestCase):
 
 
 if __name__ == "__main__":
-    from pyspark.sql.tests.arrow.test_arrow_udf_typehints import *  # noqa: 
#F401
+    from pyspark.sql.tests.arrow.test_arrow_udf_typehints import *  # noqa: 
F401
 
     try:
         import xmlrunner
diff --git a/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py 
b/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py
index 7e9f22bb94bb..d4c1cf5d62ff 100644
--- a/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py
+++ b/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py
@@ -444,7 +444,7 @@ class PandasUDFTypeHintsTests(ReusedSQLTestCase):
 
 
 if __name__ == "__main__":
-    from pyspark.sql.tests.pandas.test_pandas_udf_typehints import *  # noqa: 
#F401
+    from pyspark.sql.tests.pandas.test_pandas_udf_typehints import *  # noqa: 
F401
 
     try:
         import xmlrunner
diff --git 
a/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py
 
b/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py
index 88cc4b81778a..d2e5dd167316 100644
--- 
a/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py
+++ 
b/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py
@@ -367,7 +367,8 @@ class 
PandasUDFTypeHintsWithFutureAnnotationsTests(ReusedSQLTestCase):
 
 
 if __name__ == "__main__":
-    from 
pyspark.sql.tests.pandas.test_pandas_udf_typehints_with_future_annotations 
import *  # noqa: #F401
+    # E501: line too long
+    from 
pyspark.sql.tests.pandas.test_pandas_udf_typehints_with_future_annotations 
import *  # noqa: F401, E501
 
     try:
         import xmlrunner


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

Reply via email to