@@ -376,9 +376,11 @@ def value_counts(
376376 [
377377 ordering .OrderingExpression (
378378 ex .deref (count_id ),
379- direction = ordering .OrderingDirection .ASC
380- if ascending
381- else ordering .OrderingDirection .DESC ,
379+ direction = (
380+ ordering .OrderingDirection .ASC
381+ if ascending
382+ else ordering .OrderingDirection .DESC
383+ ),
382384 )
383385 ]
384386 )
@@ -435,22 +437,24 @@ def rank(
435437 window_ordering = (
436438 ordering .OrderingExpression (
437439 ex .deref (col ),
438- ordering .OrderingDirection .ASC
439- if ascending
440- else ordering .OrderingDirection .DESC ,
440+ (
441+ ordering .OrderingDirection .ASC
442+ if ascending
443+ else ordering .OrderingDirection .DESC
444+ ),
441445 na_last = (na_option in ["bottom" , "keep" ]),
442446 ),
443447 )
444448 # Count_op ignores nulls, so if na_option is "top" or "bottom", we instead count the nullity columns, where nulls have been mapped to bools
445449 block , rownum_id = block .apply_window_op (
446450 col if na_option == "keep" else nullity_col_id ,
447451 agg_ops .dense_rank_op if method == "dense" else agg_ops .count_op ,
448- window_spec = windows . unbound (
449- grouping_keys = grouping_cols , ordering = window_ordering
450- )
451- if method == "dense"
452- else windows . rows (
453- end = 0 , ordering = window_ordering , grouping_keys = grouping_cols
452+ window_spec = (
453+ windows . unbound ( grouping_keys = grouping_cols , ordering = window_ordering )
454+ if method == "dense"
455+ else windows . rows (
456+ end = 0 , ordering = window_ordering , grouping_keys = grouping_cols
457+ )
454458 ),
455459 skip_reproject_unsafe = (col != columns [- 1 ]),
456460 )
0 commit comments