Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Incomparable #1646

Merged
merged 13 commits into from
Dec 19, 2022
Merged

Remove Incomparable #1646

merged 13 commits into from
Dec 19, 2022

Conversation

chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Dec 14, 2022

Description

Closes #1522 .

To remove Incomparable, I made following changes.

CompareOrder has 3 function exposed

  1. Used by update for $max operator, the sort order is the same implementation of CompareOrder. This uses array as part of sort type.
  2. CompareOrderForSort is used by .sort() where comparison of array does not compare array in sort type, but uses min element of array for ascending sort and max element of array for descending sort. Empty array is less than Null for this.
  3. CompareOrderForOperator is used by operators $gt $gte $lt $lte, where array is not compared in sort type but uses the same bson type for min element of array for $lt and $lte and and max element of array for $gt and $gte

Numbers are sorted the same

  • int32, int64, float64 are no longer differentiated in the sorting, they are the same in the comparison. This matches the same behaviour on compat.

Readiness checklist

  • I added tests for new functionality or bugfixes.
  • I ran task all, and it passed.
  • I added/updated comments for both exported and unexported top-level declarations (functions, types, etc).
  • I checked comments rendering with task godocs.
  • I ensured that the title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Assignee, Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow added the code/chore Code maintenance improvements label Dec 14, 2022
@chilagrow chilagrow self-assigned this Dec 14, 2022
@vercel
Copy link

vercel bot commented Dec 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ferret-db ✅ Ready (Inspect) Visit Preview Dec 16, 2022 at 9:09AM (UTC)

@vercel vercel bot temporarily deployed to Preview December 14, 2022 01:42 Inactive
@vercel vercel bot temporarily deployed to Preview December 14, 2022 10:48 Inactive
@vercel vercel bot temporarily deployed to Preview December 15, 2022 02:20 Inactive
@vercel vercel bot temporarily deployed to Preview December 15, 2022 02:36 Inactive
@vercel vercel bot temporarily deployed to Preview December 15, 2022 11:16 Inactive
@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Merging #1646 (c8699e2) into main (14fb59a) will decrease coverage by 0.18%.
The diff coverage is 85.60%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1646      +/-   ##
==========================================
- Coverage   68.71%   68.52%   -0.19%     
==========================================
  Files         290      289       -1     
  Lines       13992    13917      -75     
==========================================
- Hits         9614     9537      -77     
+ Misses       3438     3437       -1     
- Partials      940      943       +3     
Impacted Files Coverage Δ
internal/handlers/common/update.go 86.03% <0.00%> (ø)
internal/types/compareresult_string.go 0.00% <0.00%> (ø)
internal/types/compare_order.go 82.85% <85.89%> (+1.53%) ⬆️
internal/types/compare.go 91.59% <93.02%> (+1.97%) ⬆️
internal/handlers/common/filter.go 84.86% <100.00%> (-0.86%) ⬇️
internal/handlers/common/sort.go 91.56% <100.00%> (-0.28%) ⬇️
internal/handlers/tigris/tigrisdb/errors.go 32.14% <0.00%> (-10.72%) ⬇️
internal/handlers/tigris/msg_create.go 67.60% <0.00%> (-7.05%) ⬇️
internal/handlers/tigris/tigrisdb/collections.go 61.90% <0.00%> (-4.77%) ⬇️
internal/util/version/version.go 70.58% <0.00%> (-4.42%) ⬇️
... and 9 more
Flag Coverage Δ
integration 64.39% <84.09%> (-0.21%) ⬇️
mongodb 14.55% <0.00%> (+0.04%) ⬆️
pg 53.41% <84.09%> (-0.22%) ⬇️
tigris 38.19% <52.27%> (+0.44%) ⬆️
unit 27.39% <18.18%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@vercel vercel bot temporarily deployed to Preview December 15, 2022 12:12 Inactive
@chilagrow chilagrow requested review from a team, w84thesun, rumyantseva and noisersup and removed request for a team December 15, 2022 12:17
@chilagrow chilagrow marked this pull request as ready for review December 15, 2022 12:17
@chilagrow chilagrow requested a review from a team as a code owner December 15, 2022 12:17
@vercel vercel bot temporarily deployed to Preview December 15, 2022 12:18 Inactive
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

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

Changes are looking reasonable, some pg tests are failing though.

@vercel vercel bot temporarily deployed to Preview December 16, 2022 02:37 Inactive
@chilagrow chilagrow enabled auto-merge (squash) December 16, 2022 03:04
@vercel vercel bot temporarily deployed to Preview December 16, 2022 03:33 Inactive
@vercel vercel bot temporarily deployed to Preview December 16, 2022 05:31 Inactive
@vercel vercel bot temporarily deployed to Preview December 16, 2022 09:09 Inactive
Copy link
Contributor

@w84thesun w84thesun left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

💯

@chilagrow chilagrow merged commit c6ac9e5 into FerretDB:main Dec 19, 2022
@AlekSi AlekSi added this to the v0.7.1 milestone Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove types.Incomparable
5 participants