-
Notifications
You must be signed in to change notification settings - Fork 409
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
Validate scale
param for dbStats
and collStats
correctly
#2418
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2418 +/- ##
==========================================
+ Coverage 64.38% 64.46% +0.08%
==========================================
Files 393 394 +1
Lines 19291 19349 +58
==========================================
+ Hits 12421 12474 +53
- Misses 5966 5972 +6
+ Partials 904 903 -1
... and 1 file with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
scale
param for dbStats
and collStats
correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing that there will be other PRs, so the change I suggest can be done there too.
The failing one needs attention though 🤗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work!
56e1dc5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for docs, but please add and update comments in the next PR
@@ -121,7 +121,8 @@ var ( | |||
errNotBinaryMask = fmt.Errorf("not a binary mask") | |||
errUnexpectedLeftOpType = fmt.Errorf("unexpected left operand type") | |||
errUnexpectedRightOpType = fmt.Errorf("unexpected right operand type") | |||
errLongExceeded = fmt.Errorf("long exceeded") | |||
errLongExceededPositive = fmt.Errorf("long exceeded - positive value") | |||
errLongExceededNegative = fmt.Errorf("long exceeded - negative value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added/updated comments and checked rendering.
Before submitting a pull request, please make sure that:
[…]
2. Comments are added or updated for all new or changed code.
Please add missing comments for all (both exported and unexported)
new and changed top-level declarations (functions, types, etc).
Both points were ignored.
Updated possible error results are also not documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlekSi could you please leave more specific feedback? What exactly needs to be documented here?
Sometimes when I leave comments (e.g. for structure fields) you say that they are obvious and not needed. What needs to be documented here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fields are not top-level declarations. Global variables are.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I document what each error in this list means?
Or should I document each function/method where these errors could be returned?
Or both? Or something else?
Description
Closes #1346.
This PR is one of a few PRs for #1346. It is sent separately as it covers logic related to
scale
param validation and doesn't depend on the rest of the issue.There is a minor refactoring:
errLongExceeded
error is split intoerrLongExceededNegative
anderrLongExceededPositive
because, for the params likeskip
orscale
, in case of negative overflow, we should still return a different error -- the value must be non-negative (forskip
) or positive (forscale
).See also FerretDB/dance#407 for diff tests.
Readiness checklist
task all
, and it passed.@FerretDB/core
), Assignee, Labels, Project and project's Sprint fields.