Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 63178b4

Browse files
committedMay 28, 2025·
more
1 parent 388fcfe commit 63178b4

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed
 

‎dev/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pytest-mypy-plugins==1.9.3
2727
flake8==3.9.0
2828
# See SPARK-38680.
2929
pandas-stubs<1.2.0.54
30+
types-PyYAML
3031

3132
# Documentation (SQL)
3233
mkdocs

‎dev/sparktestsupport/modules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ def __hash__(self):
555555
"pyspark.sql.tests.pandas.test_pandas_udf_typehints_with_future_annotations",
556556
"pyspark.sql.tests.pandas.test_pandas_udf_window",
557557
"pyspark.sql.tests.pandas.test_pandas_sqlmetrics",
558-
"pyspark.sql.tests.pandas.test_block_connect_access",
559-
"pyspark.sql.tests.pipelines.test_blocking_connect_access"
558+
"pyspark.sql.tests.pandas.test_converter",
559+
"pyspark.sql.tests.pipelines.test_block_connect_access",
560560
"pyspark.sql.tests.pipelines.test_cli",
561561
"pyspark.sql.tests.pipelines.test_decorators",
562562
"pyspark.sql.tests.pipelines.test_graph_element_registry",

‎python/pyspark/sql/pipelines/block_connect_access.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717
from contextlib import contextmanager
18-
from typing import Generator, Any
18+
from typing import Callable, Generator, NoReturn
1919

2020
from pyspark.errors import PySparkException
2121
from pyspark.sql.connect.proto.base_pb2_grpc import SparkConnectServiceStub
@@ -37,11 +37,11 @@ def block_spark_connect_execution_and_analysis() -> Generator[None, None, None]:
3737
original_getattr = getattr(SparkConnectServiceStub, "__getattribute__")
3838

3939
# Define a new __getattribute__ method that blocks RPC calls
40-
def blocked_getattr(self: Any, name: str) -> Any:
40+
def blocked_getattr(self: SparkConnectServiceStub, name: str) -> Callable:
4141
if name not in BLOCKED_RPC_NAMES:
4242
return original_getattr(self, name)
4343

44-
def blocked_method(*args, **kwargs):
44+
def blocked_method(*args: object, **kwargs: object) -> NoReturn:
4545
raise PySparkException(
4646
errorClass="ATTEMPT_ANALYSIS_IN_PIPELINE_QUERY_FUNCTION",
4747
messageParameters={},

‎python/pyspark/sql/pipelines/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
$ bin/spark-pipelines run --spec /path/to/pipeline.yaml
2323
"""
2424
from contextlib import contextmanager
25-
from threading import Thread
2625
import argparse
2726
import importlib.util
2827
import os
@@ -253,7 +252,8 @@ def run(spec_path: Path, remote: str) -> None:
253252
)
254253
init_parser.add_argument(
255254
"--name",
256-
help="Name of the project. A directory with this name will be created underneath the current directory.",
255+
help="Name of the project. A directory with this name will be created underneath the "
256+
"current directory.",
257257
required=True,
258258
)
259259

‎python/pyspark/sql/pipelines/init_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ def init(name: str) -> None:
6969

7070
print(f"Pipeline project '{name}' created successfully. To run your pipeline:")
7171
print(f"cd '{name}'")
72-
print(f"spark-pipelines run")
72+
print("spark-pipelines run")

0 commit comments

Comments
 (0)
Please sign in to comment.