Skip to content

Commit c164ecb

Browse files
committed
fix Ruff errors
1 parent 0ef9c4b commit c164ecb

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

python/datafusion/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def __repr__(self) -> str:
149149
"""Print a string representation of the table."""
150150
return self.table.__repr__()
151151

152-
def __datafusion_table_provider__(self) -> object: # noqa: D105
152+
def __datafusion_table_provider__(self) -> object:
153153
"""Expose the internal DataFusion table provider PyCapsule.
154154
155155
This forwards the call to the underlying Rust-backed RawTable so the

python/datafusion/context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,9 +1170,7 @@ def read_avro(
11701170
self.ctx.read_avro(str(path), schema, file_partition_cols, file_extension)
11711171
)
11721172

1173-
def read_table(
1174-
self, table: TableLike
1175-
) -> DataFrame:
1173+
def read_table(self, table: TableLike) -> DataFrame:
11761174
"""Creates a :py:class:`~datafusion.dataframe.DataFrame` from a table.
11771175
11781176
Args:

python/tests/test_catalog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ def test_register_raw_table_without_capsule(ctx: SessionContext, database, monke
169169
raw_table = schema.table("csv").table
170170

171171
def fail(*args, **kwargs):
172-
raise AssertionError("RawTable capsule path should not be invoked")
172+
msg = "RawTable capsule path should not be invoked"
173+
raise AssertionError(msg)
173174

174175
monkeypatch.setattr(type(raw_table), "__datafusion_table_provider__", fail)
175176

python/tests/test_context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ def test_read_table_accepts_table_provider(ctx):
127127

128128
expected = pa.Table.from_batches([batch])
129129

130-
provider_result = pa.Table.from_batches(
131-
ctx.read_table(provider).collect()
132-
)
130+
provider_result = pa.Table.from_batches(ctx.read_table(provider).collect())
133131
assert provider_result.equals(expected)
134132

135133
table_result = pa.Table.from_batches(ctx.read_table(table).collect())

0 commit comments

Comments
 (0)