Skip to content

Commit c002b2c

Browse files
committed
Ruff linting & format
1 parent e48dea1 commit c002b2c

File tree

6 files changed

+22
-8
lines changed

6 files changed

+22
-8
lines changed

duckdb/experimental/spark/sql/session.py

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

3232
# data is a List of rows
3333
# every value in each row needs to be turned into a Value
34-
def _combine_data_and_schema(data: Iterable[Any], schema: StructType) -> list['duckdb.Value']:
34+
def _combine_data_and_schema(data: Iterable[Any], schema: StructType) -> list["duckdb.Value"]:
3535
from duckdb import Value
3636

3737
new_data = []

scripts/generate_connection_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
os.chdir(os.path.dirname(__file__))
66

77
JSON_PATH = "connection_methods.json"
8-
PYCONNECTION_SOURCE = Path("..") / "src" / "duckdb_py" / "pyconnection.cpp"
8+
PYCONNECTION_SOURCE = Path("..") / "src" / "duckdb_py" / "pyconnection.cpp"
99

1010
INITIALIZE_METHOD = (
1111
"static void InitializeConnectionMethods(py::class_<DuckDBPyConnection, shared_ptr<DuckDBPyConnection>> &m) {"

scripts/generate_connection_wrapper_methods.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
os.chdir(os.path.dirname(__file__))
99

1010
JSON_PATH = "connection_methods.json"
11-
DUCKDB_PYTHON_SOURCE = Path("..") / "src" / "duckdb_py" / "duckdb_python.cpp"
11+
DUCKDB_PYTHON_SOURCE = Path("..") / "src" / "duckdb_py" / "duckdb_python.cpp"
1212

1313
START_MARKER = "\t// START_OF_CONNECTION_METHODS"
1414
END_MARKER = "\t// END_OF_CONNECTION_METHODS"

scripts/generate_import_cache_cpp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,9 @@ def get_module_file_path_includes(files: list[ModuleFile]):
251251

252252
module_includes = get_module_file_path_includes(files)
253253

254-
modules_header = Path(script_dir) / ".." / ("src/duckdb_py/include/duckdb_python/"
255-
"import_cache/python_import_cache_modules.hpp")
254+
modules_header = (
255+
Path(script_dir) / ".." / ("src/duckdb_py/include/duckdb_python/import_cache/python_import_cache_modules.hpp")
256+
)
256257
with open(modules_header, "w") as f:
257258
f.write(module_includes)
258259

scripts/get_cpp_methods.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,21 @@ def on_class_method(self, state, node):
5252

5353
def get_methods(class_name: str) -> dict[str, ConnectionMethod]:
5454
CLASSES = {
55-
"DuckDBPyConnection": Path(scripts_folder) / ".." / "src" / "duckdb_py" / "include" / "duckdb_python" / "pyconnection" / "pyconnection.hpp", # noqa: E501
56-
"DuckDBPyRelation": Path(scripts_folder) / ".." / "src" / "duckdb_py" / "include" / "duckdb_python" / "pyrelation.hpp", # noqa: E501
55+
"DuckDBPyConnection": Path(scripts_folder)
56+
/ ".."
57+
/ "src"
58+
/ "duckdb_py"
59+
/ "include"
60+
/ "duckdb_python"
61+
/ "pyconnection"
62+
/ "pyconnection.hpp",
63+
"DuckDBPyRelation": Path(scripts_folder)
64+
/ ".."
65+
/ "src"
66+
/ "duckdb_py"
67+
/ "include"
68+
/ "duckdb_python"
69+
/ "pyrelation.hpp",
5770
}
5871

5972
path = CLASSES[class_name]

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import shutil
44
import warnings
55
from importlib import import_module
6-
from os.path import abspath, dirname, join, normpath
6+
from os.path import abspath
77
from pathlib import Path
88
from typing import Any
99

0 commit comments

Comments
 (0)