objectiv-analytics icon indicating copy to clipboard operation
objectiv-analytics copied to clipboard

WIP: Bach - extracted order_by_expression function

Open thijs-obj opened this issue 3 years ago • 4 comments

Based on review comment https://github.com/objectiv/objectiv-analytics/pull/1062#discussion_r928295212

@KathiaBarahona does this match what you had intended?

thijs-obj avatar Jul 25 '22 19:07 thijs-obj

lgtm, tho I'm not sure if get_order_by_expression should be in partitioning module.

It's used by window functions and an aggregate function, so this seemed like an okayish place to put it. Do you have a concrete proposal that you think is better?

thijs-obj avatar Jul 26 '22 13:07 thijs-obj

desc + nulls first is wrong

What do you mean by wrong? Is this different from what Pandas does, or how we did it in the past, or ... ?

thijs-obj avatar Aug 01 '22 09:08 thijs-obj

desc + nulls first is wrong

What do you mean by wrong? Is this different from what Pandas does, or how we did it in the past, or ... ?

( I'm dumb, was replying on your comment)

See https://github.com/objectiv/objectiv-analytics/pull/1070#discussion_r934263974

when nulls_last is False and order_by.asc is False, the final expression in the order by clause is setting ORDER BY COLUMN desc nulls last

is yielding the same expression when having nulls_last is True and order_by.asc is False

kathia-barahona avatar Aug 01 '22 10:08 kathia-barahona

desc + nulls first is wrong

What do you mean by wrong? Is this different from what Pandas does, or how we did it in the past, or ... ?

( I'm dumb, was replying on your comment)

See #1070 (comment)

when nulls_last is False and order_by.asc is False, the final expression in the order by clause is setting ORDER BY COLUMN desc nulls last

is yielding the same expression when having nulls_last is True and order_by.asc is False

Let's discuss tomorrow after stand-up. I am not quite following what you mean. To me it looks like the behaviour of the function matches what the docstring says it does, and the test for SeriesString keeps working. I agree that this might change things for window functions, but I believe your PR fixes that?

thijs-obj avatar Aug 01 '22 12:08 thijs-obj

Closing this PR. PR https://github.com/objectiv/objectiv-analytics/pull/1089 contains all commits in this branch, with a lot more refinement added

thijs-obj avatar Aug 11 '22 12:08 thijs-obj