Skip to content

[order_by] Deprecate using order_value from payload, dedup by (order_value, id) tuple - #6233

Merged
coszio merged 5 commits into
devfrom
deprecate-order-value-in-payload
Mar 27, 2025
Merged

coszio merged 5 commits into
devfrom
deprecate-order-value-in-payload

Conversation

@coszio

@coszio coszio commented Mar 24, 2025

Copy link
Copy Markdown
Contributor

Initially, we started inserting the order_by value in the payload. Since version 1.11 we can already deprecate this behavior because now we have a dedicated field in the point struct.

This PR removes the legacy code which inserted and removed the order_by value in the payload.

@coszio
coszio requested review from generall and removed request for generall March 24, 2025 18:55
@coszio
coszio force-pushed the deprecate-order-value-in-payload branch from c5087af to 0ebb6c8 Compare March 24, 2025 19:01
@coderabbitai

This comment was marked as resolved.

Comment on lines +349 to +361
// This means that the same point will be repeated only if there is an alternating order value with another point
// E.g.
// For these points
// { id: 1, values: [11, 21]}
// { id: 2, values: [12, 22, 32]}
//
// The output will be
// { id: 1, order_value: 11 }
// { id: 2, order_value: 12 }
// { id: 1, order_value: 21 }
// { id: 2, order_value: 22 }
// (no order_value 32)
.dedup_by(|record_a, record_b| record_a.id == record_b.id)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this desirable behavior?

Could we other wise dedup by the tuple (record_a.id, record_a.order_value)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the same opinion, here I only documented the current behavior.

IIRC, the intention for this is that the case when a point has many values, to only use one of them if they are consecutive, and there is no interleaving with another point. But tbh, it looks more like a bug, like it puzzled even ourselves.

@generall thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed in c07682d

@timvisee timvisee Mar 26, 2025 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think this is better!

There does seem to be some unit test failure now, but the test may be wrong.

coderabbitai[bot]

This comment was marked as resolved.

@coszio coszio changed the title [order_by] Deprecate using order_value from payload [order_by] Deprecate using order_value from payload, dedup by (order_value, id) tuple Mar 27, 2025
@coszio
coszio merged commit 3ad3530 into dev Mar 27, 2025
@coszio
coszio deleted the deprecate-order-value-in-payload branch March 27, 2025 13:07
timvisee added a commit that referenced this pull request Mar 31, 2025
…er_value, id)` tuple (#6233)

* deprecate inserting order_value in payload, use the one in the struct instead

* fix for test

* dedup by (order_value, id) tuple

* Scroll dedup test must also consider order value

* Update assert message, include order value

---------

Co-authored-by: timvisee <[email protected]>
@timvisee timvisee mentioned this pull request Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants