Skip to content

Commit 3059674

Browse files
committed
Fix ruff lints for example scripts
1 parent beab721 commit 3059674

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎examples/datafusion-ffi-example/python/tests/_test_run_demo.py‎

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

66
def test_run_demo():
77
script = Path(__file__).parent.parent.parent / "run_demo.py"
8-
result = subprocess.run(
8+
result = subprocess.run( # noqa: S603
99
[sys.executable, str(script)],
1010
capture_output=True,
1111
text=True,

‎examples/datafusion-ffi-example/run_demo.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
catalog provider, config extension, codec round-trip, then the same bytes
66
decoded a second time.
77
"""
8+
89
import sys
910

1011
try:
@@ -18,9 +19,7 @@
1819
except ImportError:
1920
sys.exit("build the extension first:\n uv run maturin develop\nSee README.md.")
2021

21-
from datafusion import LogicalPlan, SessionConfig, SessionContext, udf
22-
23-
22+
from datafusion import LogicalPlan, SessionConfig, SessionContext, udf # noqa: I001, E402
2423

2524

2625
print("1. table provider")
@@ -38,7 +37,9 @@
3837

3938
print("\n4. config extension")
4039
config = MyConfig()
41-
config = SessionConfig({"datafusion.catalog.information_schema": "true"}).with_extension(config)
40+
config = SessionConfig(
41+
{"datafusion.catalog.information_schema": "true"}
42+
).with_extension(config)
4243
config.set("my_config.baz_count", "42")
4344
ctx2 = SessionContext(config)
4445
ctx2.sql("SHOW my_config.baz_count;").show()

‎examples/datafusion-ffi-query-planner-example/python/tests/_test_run_demo.py‎

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

66
def test_run_demo():
77
script = Path(__file__).parent.parent.parent / "run_demo.py"
8-
result = subprocess.run(
8+
result = subprocess.run( # noqa: S603
99
[sys.executable, str(script)],
1010
capture_output=True,
1111
text=True,

‎examples/datafusion-ffi-query-planner-example/run_demo.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
plan returned, the effect of SET ffi_query_planner.max_rows, and two
66
planners nesting.
77
"""
8+
89
import sys
910

1011
try:
@@ -15,16 +16,16 @@
1516
except ImportError:
1617
sys.exit("build the extension first:\n uv run maturin develop\nSee README.md.")
1718

18-
from datafusion import SessionConfig, SessionContext
19-
20-
19+
from datafusion import SessionConfig, SessionContext # noqa: I001, E402
2120

2221

2322
print("1. logical plan")
2423
config = SessionConfig().with_extension(MyPlannerConfig(max_rows=5))
2524
ctx = SessionContext(config)
2625

27-
ctx.sql("CREATE TABLE t AS SELECT * FROM (VALUES (1), (2), (3), (4), (5), (6), (7)) AS t(a)")
26+
ctx.sql(
27+
"CREATE TABLE t AS SELECT * FROM (VALUES (1), (2), (3), (4), (5), (6), (7)) AS t(a)"
28+
)
2829
df = ctx.sql("SELECT * FROM t")
2930
print(df.logical_plan().display_indent())
3031

0 commit comments

Comments
 (0)