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

Implement Table.order_by for SQLite and the common scaffolding for all backends #3502

Merged
merged 21 commits into from
Jun 6, 2022

Conversation

radeusgd
Copy link
Member

@radeusgd radeusgd commented Jun 1, 2022

Pull Request Description

Implements the common and SQLite parts of https://www.pivotaltracker.com/story/show/182195405

Important Notes

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide dist and ./run ide watch.

@radeusgd radeusgd self-assigned this Jun 1, 2022
@radeusgd radeusgd force-pushed the wip/radeusgd/database-table-order-by-182195405 branch 3 times, most recently from 3285734 to 4d6cf9b Compare June 3, 2022 17:17
@radeusgd radeusgd changed the title Scaffolding for the Table.order_by method Implement Table.order_by for SQLite and the common scaffolding for all backends Jun 3, 2022
@radeusgd radeusgd force-pushed the wip/radeusgd/database-table-order-by-182195405 branch from 8b9c576 to 2497df5 Compare June 4, 2022 19:00
@radeusgd radeusgd marked this pull request as ready for review June 4, 2022 19:19
Copy link
Member

@jdunkerley jdunkerley left a comment

Choose a reason for hiding this comment

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

Couple of minor comments but looks good

Checks if the provided value does not have any attached problems.
assume_no_problems result =
result.is_error.should_be_false
warnings = Warning.get_all result . map .value
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
warnings = Warning.get_all result . map .value
Warning.get_all result . length . should_equal 0

Copy link
Member Author

Choose a reason for hiding this comment

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

I deliberately did it this way.
If we did as you suggest, if the test fails it will display 1 did not equal 0 or something like that, not too informative.

But with the original approach I did, we'd get [Some_Warning] did not equal [] - so you immediately see what is the unexpected warning that got reported and IMO this helps with debugging the tests.

- If two name matchers match the same column, a
`Column_Matched_By_Multiple_Selectors`.
- If no valid columns are selected, a `No_Input_Columns_Selected`.
- If values do not implement an ordering, an
Copy link
Member

Choose a reason for hiding this comment

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

don't think this can occur here - only true for in-memory I think

Copy link
Member Author

Choose a reason for hiding this comment

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

True, I kept this to have the documentation consistent between variants. I thought we want the docstrings to be the same, but I'm not sure, happy to change it if you think slight differences are ok.

My line of thinking is just that it may be confusing to the users because we try to make the differences between inmem and db rather opaque and so the user may read the doc for one and thing it applies in both variants.
OTOH there are some differences and so they may be worth highlighting.

Maybe some compromise would be to keep the docstring the same but highlight differences? For example I can add (only applicable in the In_Memory backend which can hold custom types) here. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

no happy to leave as is for that reason - worse case they add error handling for an impossible scenario but basically harmless


In case the selectors have differing metadata and the error does not prevent
the operation from continuing, the first selector on the list is used.
type Column_Matched_By_Multiple_Selectors (column_name : Text) (selectors : [Any])
Copy link
Member

Choose a reason for hiding this comment

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

We should be consistent on [Any] versus Vector Any

Copy link
Member Author

Choose a reason for hiding this comment

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

As discussed, we'll make a separate task to align these, as this applies to the whole codebase.

@radeusgd radeusgd added the CI: Ready to merge This PR is eligible for automatic merge label Jun 6, 2022
@mergify mergify bot merged commit 7d94efa into develop Jun 6, 2022
@mergify mergify bot deleted the wip/radeusgd/database-table-order-by-182195405 branch June 6, 2022 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants