-
Notifications
You must be signed in to change notification settings - Fork 323
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
Extend Aggregate_Spec test suite with tests for missed edge-cases to ensure the feature is well-tested on all backends #3383
Extend Aggregate_Spec test suite with tests for missed edge-cases to ensure the feature is well-tested on all backends #3383
Conversation
8cc25b9
to
490e7f1
Compare
9fa5e78
to
4fea088
Compare
std-bits/table/src/main/java/org/enso/table/aggregations/Concatenate.java
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/aggregations/Concatenate.java
Outdated
Show resolved
Hide resolved
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.
Generally LGTM but a few little tweaks please
WIP: Postgres not returning correct results ?
…rors This is a temporary solution which may need to be reverted once a proper solution is developed.
f627191
to
95df815
Compare
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.
nits
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Number/Extensions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso
Show resolved
Hide resolved
case matches of | ||
True -> Success | ||
False -> | ||
loc = Meta.get_source_location 2+frames_to_skip |
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 know this was here before but where does the magic 2
come from?
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.
The number of frames of how deep inside of should_equal
we are. I think the case
itself adds one frame and then the particular branch another - was experimentally measured to give the correct result. Maybe worth double-checking.
Ideally we should have tests for this - but currently we do not have a robust way to test the test suite using the test suite, I think :D
@@ -64,7 +64,9 @@ private Text doComplexAtom(Atom atom) { | |||
|
|||
@CompilerDirectives.TruffleBoundary | |||
private String showObject(Object child) throws UnsupportedMessageException { | |||
if (child instanceof Boolean) { | |||
if (child == null) { | |||
return "null"; |
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.
Shouldn't this be "Nothing"?
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.
Good question, I don't know. This is not really a Nothing
instance but an unitialized value.
This relates to the recursive bug thread on Discord.
This is just a minimal workaround to avoid errors that are hard to debug when a null
leaks into these methods (up to now, the showObject
would fail when trying to display the original error so we'd get just a random NPE without any knowledge of the underlying issue, this fix allows us to see the issue more clearly).
This is not a good fix really - it's in no way comprehensive - there are still places where I think the null
could leak - I just plumbed the ones I encountered. A proper fix was, like @kustosz suggested, adding null-checks at the reads, or if I understand correctly we could introduce some non-null sentinel value to which uninitialized data could be set when running its initialization. Then these particular checks will become redundant and should be removed.
So I guess I could add a TODO here with a link to https://www.pivotaltracker.com/story/show/181652974
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.
👍
Pull Request Description
Implements https://www.pivotaltracker.com/story/show/181805693 and finishes the basic set of features of the Aggregate component.
Still not all aggregations are supported everywhere, because for example SQLite has quite limited support for aggregations. Currently the workaround is to bring the table into memory (if possible) and perform the computation locally. Later on, we may add more complex generator features to emulate the missing aggregations with complex sub-queries.
Important Notes
Checklist
Please include the following checklist in your PR:
./run dist
and./run watch
.