Skip to content

ref(metrics): Improve type hints for set metrics - #3048

Merged
elramen merged 2 commits into
masterfrom
metric-type-hints
May 14, 2024
Merged

elramen merged 2 commits into
masterfrom
metric-type-hints

Conversation

@elramen

@elramen elramen commented May 6, 2024

Copy link
Copy Markdown
Member

Remove MetricValue from the set metric's value type hint. MetricValue is a union that includes floatwhich is correct based on how other parts of the code uses MetricValue. However, as floats are intentionally floored for set metrics, the current type hint might be confusing for a user as it looks like floats would work as unique values in a set.

Fixes GH-3038

@elramen
elramen requested a review from szokeasaurusrex May 6, 2024 12:21

@szokeasaurusrex szokeasaurusrex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! But, before merging, please rename the commit to ref(metrics) ...

@elramen elramen changed the title ref(typing): Improve type hints for set metrics ref(metrics): Improve type hints for set metrics May 14, 2024
@elramen
elramen merged commit cc11c0f into master May 14, 2024
@elramen
elramen deleted the metric-type-hints branch May 14, 2024 15:59
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.

Misleading set metric value type hint

2 participants