-
Notifications
You must be signed in to change notification settings - Fork 4
Update API and add support for start_immediately #105
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
Conversation
Marenz
commented
Nov 7, 2024
- Update API dependency
- CLI: Change interval default to 1
- Add support for start_immediately
* selector was renamed to target * start_immediately was added in the proto rpc create Signed-off-by: Mathias L. Baumann <[email protected]> # Conflicts: # src/frequenz/client/dispatch/_client.py # src/frequenz/client/dispatch/_internal_types.py # src/frequenz/client/dispatch/types.py # tests/test_proto.py
We basically never want 0 here. Signed-off-by: Mathias L. Baumann <[email protected]>
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.
| if isinstance(value, datetime) or value == "NOW": | ||
| return cast(datetime | Literal["NOW"], value) |
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.
Since you are also returning Literal["NOW"] below to do a more relaxed comparison to "NOW", wouldn't it be easier and avoid the cast to just do this here?
| if isinstance(value, datetime) or value == "NOW": | |
| return cast(datetime | Literal["NOW"], value) | |
| if isinstance(value, datetime): | |
| return value |
| return cast(datetime | Literal["NOW"], value) | ||
|
|
||
| try: | ||
| if value in ("NOW", "now"): |
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.
| if value in ("NOW", "now"): | |
| if value.upper() == "NOW": |
|
|
Signed-off-by: Mathias L. Baumann <[email protected]>