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

Allow string duration/period parameters for GRPC time table creation #4085

Merged
merged 13 commits into from
Aug 1, 2023

Conversation

lbooker42
Copy link
Contributor

Closes #4050

@lbooker42
Copy link
Contributor Author

This PR requires some changes to the Go client before it can merge.

@niloc132
Copy link
Member

Filed #4219 to follow-up and correctly update the Go client (and revert #4211).

jmao-denver
jmao-denver previously approved these changes Jul 28, 2023
@pete-petey pete-petey modified the milestones: June 2023, August 2023 Jul 31, 2023
@@ -53,7 +53,7 @@ def __init__(self, table):


class TimeTableOp(TableOp):
def __init__(self, start_time: int = 0, period: int = 1000000000):
def __init__(self, start_time: Union[int, str] = 0, period: Union[int, str] = 1000000000):
Copy link
Member

Choose a reason for hiding this comment

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

I see a few problems here:

  • In the python API, we put period first in the args list, because it should never have a default. Here it is second AND has a default.
  • The default zero start time argument is problematic, because 0 nanoseconds is a valid but unusual start time. The default argument should be some form of "now"

Suggestions:

  1. reverse the argument order.
  2. remove defaults for period
  3. pick a different null value for start time.

@jmao-denver should comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I discussed this with @jmao-denver and this is the internal API. We supply None as a default argument in the user-facing API in session.py. This default is never used.

Copy link
Member

Choose a reason for hiding this comment

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

If we never use the defaults and it is internal, at a minimum, I would remove the defaults at a minimum. If it is possible that this gets exposed in the future, I would also reverse the parameter order.

Copy link
Member

Choose a reason for hiding this comment

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

In particular, the default period bothers me. The default value there is completely arbitrary and users will always specify a value they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the internal defaults and now handle the None value by setting start_time = 0.

The order of the parameters matches the GRPC member structure, it can be changed but unsure the benefit it will bring.

py/client/pydeephaven/session.py Outdated Show resolved Hide resolved
@lbooker42 lbooker42 requested a review from chipkent July 31, 2023 21:16
@lbooker42 lbooker42 merged commit e3aad78 into deephaven:main Aug 1, 2023
10 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2023
@lbooker42 lbooker42 deleted the lab-timetable-grpc branch June 26, 2024 19:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GRPC: Allow string duration/period parameters for TimeTable creation
7 participants