Skip to content

Commit 5146c6f

Browse files
committed
Ruff format fixes
1 parent 0843038 commit 5146c6f

File tree

271 files changed

+6751
-6183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

271 files changed

+6751
-6183
lines changed

duckdb/__init__.py

Lines changed: 284 additions & 287 deletions
Large diffs are not rendered by default.

duckdb/__init__.pyi

Lines changed: 604 additions & 180 deletions
Large diffs are not rendered by default.

duckdb/bytes_io_wrapper.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,3 @@ def read(self, n: Union[int, None] = -1) -> bytes:
6363
to_return = combined_bytestring[:n]
6464
self.overflow = combined_bytestring[n:]
6565
return to_return
66-

duckdb/experimental/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
from . import spark
2+
23
__all__ = spark.__all__

duckdb/experimental/spark/_globals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class _NoValueType:
5656

5757
__instance = None
5858

59-
def __new__(cls) -> '_NoValueType':
59+
def __new__(cls) -> "_NoValueType":
6060
# ensure that only one instance exists
6161
if not cls.__instance:
6262
cls.__instance = super(_NoValueType, cls).__new__(cls)

duckdb/experimental/spark/_typing.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@
3030

3131

3232
class SupportsIAdd(Protocol):
33-
def __iadd__(self, other: "SupportsIAdd") -> "SupportsIAdd":
34-
...
33+
def __iadd__(self, other: "SupportsIAdd") -> "SupportsIAdd": ...
3534

3635

3736
class SupportsOrdering(Protocol):
38-
def __lt__(self, other: "SupportsOrdering") -> bool:
39-
...
37+
def __lt__(self, other: "SupportsOrdering") -> bool: ...
4038

4139

42-
class SizedIterable(Protocol, Sized, Iterable[T_co]):
43-
...
40+
class SizedIterable(Protocol, Sized, Iterable[T_co]): ...
4441

4542

4643
S = TypeVar("S", bound=SupportsOrdering)

duckdb/experimental/spark/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class SparkContext:
1010
def __init__(self, master: str) -> None:
11-
self._connection = duckdb.connect(':memory:')
11+
self._connection = duckdb.connect(":memory:")
1212
# This aligns the null ordering with Spark.
1313
self._connection.execute("set default_null_order='nulls_first_on_asc_last_on_desc'")
1414

duckdb/experimental/spark/errors/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"""
1919
PySpark exceptions.
2020
"""
21+
2122
from .exceptions.base import ( # noqa: F401
2223
PySparkException,
2324
AnalysisException,

duckdb/experimental/spark/errors/exceptions/base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from ..utils import ErrorClassesReader
44

5+
56
class PySparkException(Exception):
67
"""
78
Base Exception for handling errors generated from PySpark.
@@ -79,6 +80,7 @@ def __str__(self) -> str:
7980
else:
8081
return self.message
8182

83+
8284
class AnalysisException(PySparkException):
8385
"""
8486
Failed to analyze a SQL query plan.

duckdb/experimental/spark/errors/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def get_error_message(self, error_class: str, message_parameters: dict[str, str]
3737
# Verify message parameters.
3838
message_parameters_from_template = re.findall("<([a-zA-Z0-9_-]+)>", message_template)
3939
assert set(message_parameters_from_template) == set(message_parameters), (
40-
f"Undefined error message parameter for error class: {error_class}. "
41-
f"Parameters: {message_parameters}"
40+
f"Undefined error message parameter for error class: {error_class}. Parameters: {message_parameters}"
4241
)
4342
table = str.maketrans("<>", "{}")
4443

0 commit comments

Comments
 (0)