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

41-unique-log-id #47

Merged
merged 4 commits into from
Jul 10, 2024
Merged

41-unique-log-id #47

merged 4 commits into from
Jul 10, 2024

Conversation

jlhitzeman
Copy link
Contributor

No description provided.

Copy link
Contributor

@rc10house rc10house left a comment

Choose a reason for hiding this comment

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

Review in

@@ -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))
Copy link
Contributor

@rc10house rc10house Jul 9, 2024

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

tests/test_log.py Show resolved Hide resolved
@@ -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
Copy link
Contributor

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

Copy link
Contributor

@rc10house rc10house left a 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

Copy link
Contributor

@EandrewJones EandrewJones left a comment

Choose a reason for hiding this comment

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

A few nits :)

distill/schemas/base.py Outdated Show resolved Hide resolved
distill/schemas/userale.py Show resolved Hide resolved
distill/schemas/userale.py Show resolved Hide resolved
distill/schemas/base.py Show resolved Hide resolved
@EandrewJones EandrewJones merged commit b91be60 into apache:master Jul 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants