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

feat: a new PartitionedTableService API in Python #6175

Merged
merged 45 commits into from
Nov 1, 2024

Conversation

jmao-denver
Copy link
Contributor

@jmao-denver jmao-denver commented Oct 7, 2024

Copy link
Member

Choose a reason for hiding this comment

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

All of the pydocs in this file are very opaque. They are the kind of docs that make sense only after understanding how everything works. They will not be clear to new users. This is probably made worse by not having a package pydoc to provide some sort of overview. I can say that my review is harder than necessary because of the docs and lack of breadcrumbs for motivation on what is going on and why.

Overall, the docs are so unclear that I quit reviewing early.

Copy link
Member

Choose a reason for hiding this comment

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

Your analysis of the TableDataService is correct; it's really hard to understand without being able to look at it from a higher level. Ideally, we should have a deephaven.io level documentation that describes the approach, the code/type hierarchy, and offers a simple sample.

I would not expect any form of casual user to stumble onto this API and try to use it without following some form of descriptive tutorial.

Copy link
Member

Choose a reason for hiding this comment

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

In spite of all of that deflection, this package doc usability is the worst out of our entire python API. Some effort should be made to at least create a package docstring that provides enough high level view so that a user knows if they want to battle with trying to understand the rest of the docs in the package.

py/server/tests/test_partitioned_table_service.py Outdated Show resolved Hide resolved
py/server/tests/test_partitioned_table_service.py Outdated Show resolved Hide resolved
py/server/tests/test_partitioned_table_service.py Outdated Show resolved Hide resolved
py/server/tests/test_partitioned_table_service.py Outdated Show resolved Hide resolved
py/server/tests/test_partitioned_table_service.py Outdated Show resolved Hide resolved
Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Caught up

py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

In spite of all of that deflection, this package doc usability is the worst out of our entire python API. Some effort should be made to at least create a package docstring that provides enough high level view so that a user knows if they want to battle with trying to understand the rest of the docs in the package.

Copy link
Contributor Author

@jmao-denver jmao-denver left a comment

Choose a reason for hiding this comment

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

Just a question: I noticed that table_locations has a success_cb but table_schema and table_location_size don't. A bit inconsistent IMO.

py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
py/server/deephaven/experimental/table_data_service.py Outdated Show resolved Hide resolved
notifyAll();
}

public synchronized T awaitResult(@NotNull final Function<Exception, RuntimeException> errorMapper) {
Copy link
Member

Choose a reason for hiding this comment

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

Seems weird that errorMapper accepts an Exception, but error is a RuntimeException. Maybe we want to be more permissive in specifying error, or just get rid of errorMapper?

Copy link
Member

Choose a reason for hiding this comment

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

I wanted the mapper to guarantee that we can throw it without declaring that the method call throws. I wanted to be permissive on the way into the mapper so we could setError to an IOException, for example.

However, I do see that I ended up wrapping the IOException in an UncheckedDeephavenException anyway .. and then that might be wrapped in a TableDataException.

The benefit of the mapper is to capture that the error may have originated off-thread and therefore both stack traces may have real value to the user. As well as, to move specifics about the call into the mapper (for consistency in error message) and allow for the internal error to not necessarily care the origin of the request.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, actually, the Exception entry to the helper is because of the interrupted exception in awaitResult. Will make the holder more permissible.

try {
processTableLocationKey(definition, tableKey, listener, tableLocationKey, byteBuffers);
} catch (final RuntimeException e) {
asyncState.setError(e);
Copy link
Member

Choose a reason for hiding this comment

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

In a similar case for table_schema, you wrapped in an IllegalArgumentException.

Copy link
Member

Choose a reason for hiding this comment

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

You're right; I would rather not wrap in table_schema -- that should catch a RuntimeException and not Exception.

Copy link
Member

Choose a reason for hiding this comment

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

Well, technically the wrapper in table_schema specifies which schema failed to parse.. I'll clarify tomorrow.

nbauernfeind and others added 2 commits October 30, 2024 12:46
…ge/util/PythonTableDataService.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
…ge/util/PythonTableDataService.java

Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
@nbauernfeind
Copy link
Member

Just a question: I noticed that table_locations has a success_cb but table_schema and table_location_size don't. A bit inconsistent IMO.

This because they are only allowed to call the schema_cb and size_cb one time and doing so indicates success.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

.

Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

Suggested a change to the tl sub code.

@nbauernfeind nbauernfeind enabled auto-merge (squash) October 31, 2024 23:54
Copy link
Member

@rcaudy rcaudy left a comment

Choose a reason for hiding this comment

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

I'm ready to approve. I understand there's a bit more testing ongoing.

@nbauernfeind nbauernfeind merged commit dfec8b9 into deephaven:main Nov 1, 2024
17 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2024
@deephaven-internal
Copy link
Contributor

Labels indicate documentation is required. Issues for documentation have been opened:

Community: deephaven/deephaven-docs-community#353

@jmao-denver jmao-denver deleted the 6171-py-TableService branch November 11, 2024 23:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A new Python TableService API
5 participants