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

labels() returns _Metric type instead of Self #57

Open
pradishb opened this issue Oct 5, 2024 · 0 comments · May be fixed by #58
Open

labels() returns _Metric type instead of Self #57

pradishb opened this issue Oct 5, 2024 · 0 comments · May be fixed by #58
Labels
bug Something isn't working

Comments

@pradishb
Copy link

pradishb commented Oct 5, 2024

from pytheus.metrics import Gauge

gauge = Gauge(
    "room_temperature", "temperature in the living room", ["room_name"]
)

gauge.labels(room_name="bedroom").set(25)

# pyright throws an error
# Cannot access attribute "set" for class "_Metric"
#
# gauge.labels(room_name="bedroom") should return Gauge type, not _Metric
@pradishb pradishb changed the title labels() return _Metric type instead of Self labels() returns _Metric type instead of Self Oct 5, 2024
@pradishb pradishb linked a pull request Oct 5, 2024 that will close this issue
@Llandy3d Llandy3d added the bug Something isn't working label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants