Skip to content

Commit da3634f

Browse files
committed
More ruff formatting
1 parent 15b6022 commit da3634f

File tree

4 files changed

+23
-24
lines changed

4 files changed

+23
-24
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ ignore = [
7171
"ANN401", # Allow Any for wrapper classes
7272
"COM812", # Recommended to ignore these rules when using with ruff-format
7373
"FIX002", # Allow TODO lines - consider removing at some point
74+
"FBT001", # Allow boolean positional args
75+
"FBT002", # Allow boolean positional args
7476
"ISC001", # Recommended to ignore these rules when using with ruff-format
7577
"SLF001", # Allow accessing private members
7678
"TD002",

python/datafusion/functions.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@
8383
"array_sort",
8484
"array_to_string",
8585
"array_union",
86-
"arrow_typeof",
8786
"arrow_cast",
87+
"arrow_typeof",
8888
"ascii",
8989
"asin",
9090
"asinh",
@@ -99,6 +99,7 @@
9999
"bool_and",
100100
"bool_or",
101101
"btrim",
102+
"cardinality",
102103
"case",
103104
"cbrt",
104105
"ceil",
@@ -118,6 +119,7 @@
118119
"covar",
119120
"covar_pop",
120121
"covar_samp",
122+
"cume_dist",
121123
"current_date",
122124
"current_time",
123125
"date_bin",
@@ -127,26 +129,28 @@
127129
"datetrunc",
128130
"decode",
129131
"degrees",
132+
"dense_rank",
130133
"digest",
131134
"empty",
132135
"encode",
133136
"ends_with",
134-
"extract",
135137
"exp",
138+
"extract",
136139
"factorial",
137140
"find_in_set",
138141
"first_value",
139142
"flatten",
140-
"cardinality",
141143
"floor",
142144
"from_unixtime",
143145
"gcd",
144146
"in_list",
145147
"initcap",
146148
"isnan",
147149
"iszero",
150+
"lag",
148151
"last_value",
149152
"lcm",
153+
"lead",
150154
"left",
151155
"length",
152156
"levenshtein",
@@ -168,10 +172,10 @@
168172
"list_prepend",
169173
"list_push_back",
170174
"list_push_front",
171-
"list_repeat",
172175
"list_remove",
173176
"list_remove_all",
174177
"list_remove_n",
178+
"list_repeat",
175179
"list_replace",
176180
"list_replace_all",
177181
"list_replace_n",
@@ -182,34 +186,37 @@
182186
"list_union",
183187
"ln",
184188
"log",
185-
"log10",
186189
"log2",
190+
"log10",
187191
"lower",
188192
"lpad",
189193
"ltrim",
190194
"make_array",
191-
"make_list",
192195
"make_date",
196+
"make_list",
193197
"max",
194198
"md5",
195199
"mean",
196200
"median",
197201
"min",
198202
"named_struct",
199203
"nanvl",
200-
"nvl",
201204
"now",
202205
"nth_value",
206+
"ntile",
203207
"nullif",
208+
"nvl",
204209
"octet_length",
205210
"order_by",
206211
"overlay",
212+
"percent_rank",
207213
"pi",
208214
"pow",
209215
"power",
210216
"radians",
211217
"random",
212218
"range",
219+
"rank",
213220
"regexp_like",
214221
"regexp_match",
215222
"regexp_replace",
@@ -227,6 +234,7 @@
227234
"reverse",
228235
"right",
229236
"round",
237+
"row_number",
230238
"rpad",
231239
"rtrim",
232240
"sha224",
@@ -254,8 +262,8 @@
254262
"to_hex",
255263
"to_timestamp",
256264
"to_timestamp_micros",
257-
"to_timestamp_nanos",
258265
"to_timestamp_millis",
266+
"to_timestamp_nanos",
259267
"to_timestamp_seconds",
260268
"to_unixtime",
261269
"translate",
@@ -270,14 +278,6 @@
270278
"when",
271279
# Window Functions
272280
"window",
273-
"lead",
274-
"lag",
275-
"row_number",
276-
"rank",
277-
"dense_rank",
278-
"percent_rank",
279-
"cume_dist",
280-
"ntile",
281281
]
282282

283283

@@ -294,14 +294,14 @@ def nullif(expr1: Expr, expr2: Expr) -> Expr:
294294
return Expr(f.nullif(expr1.expr, expr2.expr))
295295

296296

297-
def encode(input: Expr, encoding: Expr) -> Expr:
297+
def encode(expr: Expr, encoding: Expr) -> Expr:
298298
"""Encode the ``input``, using the ``encoding``. encoding can be base64 or hex."""
299-
return Expr(f.encode(input.expr, encoding.expr))
299+
return Expr(f.encode(expr.expr, encoding.expr))
300300

301301

302-
def decode(input: Expr, encoding: Expr) -> Expr:
302+
def decode(expr: Expr, encoding: Expr) -> Expr:
303303
"""Decode the ``input``, using the ``encoding``. encoding can be base64 or hex."""
304-
return Expr(f.decode(input.expr, encoding.expr))
304+
return Expr(f.decode(expr.expr, encoding.expr))
305305

306306

307307
def array_to_string(expr: Expr, delimiter: Expr) -> Expr:

python/datafusion/input/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ def is_correct_input(self, input_item: Any, table_name: str, **kwargs: Any) -> b
4242
"""Returns `True` if the input is valid."""
4343

4444
@abstractmethod
45-
def build_table(self, input_item: Any, table_name: str, **kwarg: Any) -> SqlTable: # type: ignore[invalid-type-form]
45+
def build_table(self, input_item: Any, table_name: str, **kwarg: Any) -> SqlTable: # type: ignore[invalid-type-form]
4646
"""Create a table from the input source."""

python/datafusion/io.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
def read_parquet( # noqa: PLR0913
3737
path: str | pathlib.Path,
38-
*,
3938
table_partition_cols: list[tuple[str, str]] | None = None,
4039
parquet_pruning: bool = True,
4140
file_extension: str = ".parquet",
@@ -84,7 +83,6 @@ def read_parquet( # noqa: PLR0913
8483

8584
def read_json( # noqa: PLR0913
8685
path: str | pathlib.Path,
87-
*,
8886
schema: pa.Schema | None = None,
8987
schema_infer_max_records: int = 1000,
9088
file_extension: str = ".json",
@@ -126,7 +124,6 @@ def read_json( # noqa: PLR0913
126124

127125
def read_csv( # noqa: PLR0913
128126
path: str | pathlib.Path | list[str] | list[pathlib.Path],
129-
*,
130127
schema: pa.Schema | None = None,
131128
has_header: bool = True,
132129
delimiter: str = ",",

0 commit comments

Comments
 (0)