Skip to content

Commit 2ac0176

Browse files
committed
Ruff TD002 and TD003: added noqa for author and issue links in existing TODOs
1 parent af4d663 commit 2ac0176

29 files changed

+39
-39
lines changed

duckdb/experimental/spark/sql/column.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def __getitem__(self, k: Any) -> "Column": # noqa: ANN401
173173
# raise ValueError("Using a slice with a step value is not supported")
174174
# return self.substr(k.start, k.stop)
175175
else:
176-
# TODO: this is super hacky
176+
# TODO: this is super hacky # noqa: TD002, TD003
177177
expr_str = str(self.expr) + "." + str(k)
178178
return Column(ColumnExpression(expr_str))
179179

duckdb/experimental/spark/sql/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ def asin(col: "ColumnOrName") -> Column:
704704
+--------+
705705
"""
706706
col = _to_column_expr(col)
707-
# TODO: ConstantExpression(float("nan")) gives NULL and not NaN
707+
# TODO: ConstantExpression(float("nan")) gives NULL and not NaN # noqa: TD002, TD003
708708
return Column(
709709
CaseExpression((col < -1.0) | (col > 1.0), ConstantExpression(float("nan"))).otherwise(
710710
FunctionExpression("asin", col)

duckdb/experimental/spark/sql/group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,4 @@ def agg(self, *exprs: Union[Column, dict[str, str]]) -> DataFrame:
418418
rel = self._df.relation.select(*expressions, groups=group_by)
419419
return DataFrame(rel, self.session)
420420

421-
# TODO: add 'pivot'
421+
# TODO: add 'pivot' # noqa: TD002, TD003

duckdb/experimental/spark/sql/type_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def convert_nested_type(dtype: DuckDBPyType) -> DataType: # noqa: D103
7979
if id == "list" or id == "array":
8080
children = dtype.children
8181
return ArrayType(convert_type(children[0][1]))
82-
# TODO: add support for 'union'
82+
# TODO: add support for 'union' # noqa: TD002, TD003
8383
if id == "struct":
8484
children: list[tuple[str, DuckDBPyType]] = dtype.children
8585
fields = [StructField(x[0], convert_type(x[1])) for x in children]

duckdb/query_graph/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def calculate_percentage(self, total_time: float) -> None: # noqa: D102
8787
self.percentage = self.time / total_time
8888

8989
def combine_timing(l: "NodeTiming", r: "NodeTiming") -> "NodeTiming": # noqa: D102
90-
# TODO: can only add timings for same-phase nodes
90+
# TODO: can only add timings for same-phase nodes # noqa: TD002, TD003
9191
total_time = l.time + r.time
9292
return NodeTiming(l.phase, total_time)
9393

@@ -161,7 +161,7 @@ def get_node_body(name: str, result: str, cpu_time: float, card: int, est: int,
161161
body += f"<p>cardinality: {card}</p>"
162162
body += f"<p>estimate: {est}</p>"
163163
body += f"<p>width: {width} bytes</p>"
164-
# TODO: Expand on timing. Usually available from a detailed profiling
164+
# TODO: Expand on timing. Usually available from a detailed profiling # noqa: TD002, TD003
165165
body += "</div>"
166166
body += "</span>"
167167
return body
@@ -250,7 +250,7 @@ def generate_tree_html(graph_json: object) -> str: # noqa: D103
250250
tree_prefix = '<div class="tf-tree tf-gap-sm"> \n <ul>'
251251
tree_suffix = "</ul> </div>"
252252
# first level of json is general overview
253-
# TODO: make sure json output first level always has only 1 level
253+
# TODO: make sure json output first level always has only 1 level # noqa: TD002, TD003
254254
tree_body = generate_tree_recursive(json_graph["children"][0], cpu_time)
255255
return tree_prefix + tree_body + tree_suffix
256256

duckdb/value/constant/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def __init__(self, object: Any, members: dict[str, DuckDBPyType]) -> None:
235235
super().__init__(object, union_type)
236236

237237

238-
# TODO: add EnumValue once `duckdb.enum_type` is added
238+
# TODO: add EnumValue once `duckdb.enum_type` is added # noqa: TD002, TD003
239239

240240
__all__ = [
241241
"BinaryValue",

tests/coverage/test_pandas_categorical_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def check_create_table(category, pandas):
6868
conn.execute("DROP TABLE t1")
6969

7070

71-
# TODO: extend tests with ArrowPandas
71+
# TODO: extend tests with ArrowPandas # noqa: TD002, TD003
7272
class TestCategory:
7373
@pytest.mark.parametrize("pandas", [NumpyPandas()])
7474
def test_category_string_uint16(self, duckdb_cursor, pandas):

tests/extensions/test_httpfs.py

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

1010
# We only run this test if this env var is set
11-
# TODO: we can add a custom command line argument to pytest to provide an extension directory
11+
# TODO: we can add a custom command line argument to pytest to provide an extension directory # noqa: TD002, TD003
1212
# We can use that instead of checking this environment variable inside of conftest.py's 'require' method
1313
pytestmark = mark.skipif(
1414
not os.getenv("DUCKDB_PYTHON_TEST_EXTENSION_REQUIRED", False),

tests/fast/api/test_duckdb_connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def test_execute(self):
123123

124124
def test_executemany(self):
125125
# executemany does not keep an open result set
126-
# TODO: shouldn't we also have a version that executes a query multiple times with different parameters,
126+
# TODO: shouldn't we also have a version that executes a query multiple times with different parameters, # noqa: TD002, TD003
127127
# returning all of the results?
128128
duckdb.execute("create table tbl (i integer, j varchar)")
129129
duckdb.executemany("insert into tbl VALUES (?, ?)", [(5, "test"), (2, "duck"), (42, "quack")])

tests/fast/api/test_duckdb_execute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def generator(rowcount):
4141
yield min(2048, rowcount - count)
4242
count += 2048
4343

44-
# TODO: perhaps we want to test with different buffer sizes?
44+
# TODO: perhaps we want to test with different buffer sizes? # noqa: TD002, TD003
4545
# duckdb_cursor.execute("set streaming_buffer_size='1mb'")
4646
duckdb_cursor.execute(f"create table tbl as from range({rowcount})")
4747
duckdb_cursor.execute("select * from tbl")

0 commit comments

Comments
 (0)