-
Notifications
You must be signed in to change notification settings - Fork 32
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
python: Add metadata to log() #232
Conversation
log_time: Optional[int] = None, | ||
publish_time: Optional[int] = None, | ||
sequence: Optional[int] = None, |
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.
For typed channels, we have log(bytes)
and log_with_meta(bytes, PartialMetadata)
. We should be consistent.
FWIW, I prefer the style in this PR, or passing in metadata as optional kwargs. We could get rid of PartialMetadata
from the python API.
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.
We can either merge it into your branch, or merge it to main separately, or even discard it, as folks prefer.
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.
Passing a metadata struct works in Rust, because it's a zero-cost abstraction. In Python it's clunky and it involves an allocation.
This is built on top of @amacneil's #232, and we can either merge it into that PR branch, or merge it to main separately. The idea is to make typed channels consistent with raw channels by removing `log_with_meta` and adding keyword-only arguments to `log` for timestamps and sequence. Fixes: FG-10468
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.
🚢
Changelog
None
Docs
None
Description
Added
log()
kwargs to acceptlog_time
,publish_time
,sequence
(python: Use kwargs for metadata on typed channels #234)Remove
log_with_meta()
from python API in favor oflog()