-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: a new PartitionedTableService API in Python #6175
Conversation
a94a3dd
to
79a7085
Compare
3f24477
to
ebc3d46
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.
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.
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.
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.
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.
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.
64f2351
to
312f12d
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.
Caught up
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.
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.
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.
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.
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Outdated
Show resolved
Hide resolved
notifyAll(); | ||
} | ||
|
||
public synchronized T awaitResult(@NotNull final Function<Exception, RuntimeException> errorMapper) { |
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.
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
?
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 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.
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.
Ah, actually, the Exception
entry to the helper is because of the interrupted exception in awaitResult. Will make the holder more permissible.
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Show resolved
Hide resolved
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Outdated
Show resolved
Hide resolved
try { | ||
processTableLocationKey(definition, tableKey, listener, tableLocationKey, byteBuffers); | ||
} catch (final RuntimeException e) { | ||
asyncState.setError(e); |
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.
In a similar case for table_schema
, you wrapped in an IllegalArgumentException
.
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.
You're right; I would rather not wrap in table_schema -- that should catch a RuntimeException
and not Exception
.
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.
Well, technically the wrapper in table_schema specifies which schema failed to parse.. I'll clarify tomorrow.
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Show resolved
Hide resolved
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Show resolved
Hide resolved
…ge/util/PythonTableDataService.java Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
…ge/util/PythonTableDataService.java Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
This because they are only allowed to call the schema_cb and size_cb one time and doing so indicates success. |
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.
Suggested a change to the tl sub code.
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Outdated
Show resolved
Hide resolved
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/util/PythonTableDataService.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Ryan Caudy <rcaudy@gmail.com>
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 ready to approve. I understand there's a bit more testing ongoing.
Labels indicate documentation is required. Issues for documentation have been opened: Community: deephaven/deephaven-docs-community#353 |
Fixes #6171
Most recent nightlies run: https://github.com/nbauernfeind/deephaven-core/actions/runs/11502810543/