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

Metrics use json helper #20935

Merged

Conversation

jelly
Copy link
Member

@jelly jelly commented Aug 22, 2024

The same should be done for metrics, use get_objv but this was a drive by fix :)

FYI: Type is Python 3.9 only, are we that modern already? 😅

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

Looks sane to me, thanks! But leaving the final review to @allisonkarlitskaya

@@ -21,10 +21,10 @@
import sys
import time
from collections import defaultdict
from typing import Dict, List, NamedTuple, Optional, Set, Tuple, Union
from typing import Dict, List, NamedTuple, Optional, Set, Tuple, Type, Union
Copy link
Member

Choose a reason for hiding this comment

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

I've generally grown to prefer using the built-in versions of the types along with quoting...

So, not:

from typing import Dict, Optional, Tuple, Type

x: Optional[Dict[str, Tuple[Type[Sampler], SampleDescription]]]

but

x: 'dict[str, tuple[type[Sampler], SampleDescription]] | None'

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah but I mean the code is already there :)

Copy link
Member

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

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

Let's call it a follow-up :)

@allisonkarlitskaya allisonkarlitskaya merged commit eaf8973 into cockpit-project:main Aug 26, 2024
76 of 77 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