| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I'll squash commits when we're done |
Sorry, something went wrong.
There was a problem hiding this comment.
I gave this a first runthrough. Generally looking ok to me. A couple thoughts:
Sorry, something went wrong.
| _legacy_validation = True | ||
|
|
||
|
|
||
| def validate_metric_name(name: str) -> None: |
There was a problem hiding this comment.
Do we want these to be public now? Might be worth having them still prefixed with _ but I also think they could be useful general functions for other libraries to use.
Sorry, something went wrong.
There was a problem hiding this comment.
the functions are used by both prometheus_client and prometheus_client/openmetrics so I thought they had to be public
Sorry, something went wrong.
There was a problem hiding this comment.
Ahh, yeah Python doesn't really do public/private, it's just a convention.
Sorry, something went wrong.
There was a problem hiding this comment.
I am confused what change you want me to make, then -- leave it? prepend _? something else?
Sorry, something went wrong.
There was a problem hiding this comment.
Ahh sorry, yeah if you could prepend with _ I think that would be safest to begin with to avoid others depending on the methods.
Sorry, something went wrong.
|
Added a test, fixed an issue using .split |
Sorry, something went wrong.
| return tokens | ||
|
|
||
|
|
||
| def unquote_unescape(text): |
There was a problem hiding this comment.
maybe these should be private too?
Sorry, something went wrong.
There was a problem hiding this comment.
I would say yes, thanks!
Sorry, something went wrong.
There was a problem hiding this comment.
Just a bit of prepending with more _ and I think this is good to go! Plus cleaning up the commit history and such.
Sorry, something went wrong.
| return tokens | ||
|
|
||
|
|
||
| def unquote_unescape(text): |
There was a problem hiding this comment.
I would say yes, thanks!
Sorry, something went wrong.
part of #1013 Signed-off-by: Owen Williams <owen.williams@grafana.com>
There was a problem hiding this comment.
Thanks for this great work, LGTM!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Adding support for UTF-8 required substantial reworking of the parsing code because the previous code relied on regexes and .index calls that would incorrectly find characters inside quote marks. Note that this means the previous code was already broken for parsing exposition text where characters like braces and hashes were in label values. I have added tests to exercise the edge cases I can think of.
Does not address content negotiation, which will be a followon.
part of #1013