-
Notifications
You must be signed in to change notification settings - Fork 14
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
41-unique-log-id #47
41-unique-log-id #47
Conversation
…init, test basic functionality
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.
Review in
distill/core/log.py
Outdated
@@ -46,7 +47,8 @@ def __init__(self, data: Union[str, JsonDict], schema=UserAleSchema): | |||
raise TypeError("ERROR: " + str(type(data)) + " data should be either a string or a JsonDict") | |||
self.data = schema(**data) | |||
|
|||
# TODO: need to create ID field here on object initialization | |||
self.id = PKSUID("log", schema._timestamp(self.data)) |
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.
Bake the userId into the PKSUID as Evan mentioned in the call to make the log truly globally unique. Ex: log_userId_hash
@@ -44,6 +44,10 @@ def test_log_constructor(): | |||
pageUrl = test_log.data.page_url | |||
assert pageUrl == "https://github.com/apache/flagon/tree/master/docker" | |||
|
|||
id = test_log.id | |||
assert id.get_timestamp() == 1719530111079 // 1000 |
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.
As long as this passes it is fine, but I do not use floor division when parsing the timestamp. Just a nit pick though
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.
Looks good to me
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.
A few nits :)
No description provided.