Skip to content

Commit 4c58ecb

Browse files
gaogaotiantianHyukjinKwon
authored andcommitted
[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 <gaogaotiantian@hotmail.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent beeea01 commit 4c58ecb

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

dev/lint-python

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ if [[ -z "$COMPILE_TEST$BLACK_TEST$PYSPARK_CUSTOM_ERRORS_CHECK_TEST$FLAKE8_TEST$
7979
BLACK_TEST=true
8080
PYSPARK_CUSTOM_ERRORS_CHECK_TEST=true
8181
FLAKE8_TEST=true
82+
RUFF_TEST=true
8283
MYPY_TEST=true
8384
MYPY_EXAMPLES_TEST=true
8485
MYPY_DATA_TEST=true

dev/spark-test-image/lint/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
8080
RUN python3.11 -m pip install \
8181
'black==23.12.1' \
8282
'flake8==3.9.0' \
83+
'ruff==0.14.8' \
8384
'googleapis-common-protos-stubs==2.2.0' \
8485
'grpc-stubs==1.24.11' \
8586
'grpcio-status==1.76.0' \

python/pyspark/sql/pandas/serializers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@ def load_stream(self, stream):
12161216
Each outer iterator element represents a group, containing an iterator of Series lists
12171217
(one list per batch).
12181218
"""
1219-
import pyarrow as pa
12201219

12211220
def process_group(batches: "Iterator[pa.RecordBatch]"):
12221221
# Convert each Arrow batch to pandas Series list on-demand, yielding one list per batch

python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ def multiply_pandas(a: pd.Series, b: pd.Series) -> pd.Series:
461461

462462

463463
if __name__ == "__main__":
464-
from pyspark.sql.tests.arrow.test_arrow_udf_typehints import * # noqa: #F401
464+
from pyspark.sql.tests.arrow.test_arrow_udf_typehints import * # noqa: F401
465465

466466
try:
467467
import xmlrunner

python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def multiply_arrow(a: pa.Array, b: pa.Array) -> pa.Array:
444444

445445

446446
if __name__ == "__main__":
447-
from pyspark.sql.tests.pandas.test_pandas_udf_typehints import * # noqa: #F401
447+
from pyspark.sql.tests.pandas.test_pandas_udf_typehints import * # noqa: F401
448448

449449
try:
450450
import xmlrunner

python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,8 @@ def func(col: "Union[pd.Series, pd.DataFrame]", *, col2: "pd.DataFrame") -> "pd.
367367

368368

369369
if __name__ == "__main__":
370-
from pyspark.sql.tests.pandas.test_pandas_udf_typehints_with_future_annotations import * # noqa: #F401
370+
# E501: line too long
371+
from pyspark.sql.tests.pandas.test_pandas_udf_typehints_with_future_annotations import * # noqa: F401, E501
371372

372373
try:
373374
import xmlrunner

0 commit comments

Comments
 (0)