-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow query parameters on endpoints. Fix various endpoints. #172
Conversation
Dear @chintal, thank you very much for your contribution. Your patch looks sane, I don't know why the PR fails on CI/GHA, we will need to look into that. With kind regards, |
The failures look like they are some old tests failing. main by itself fails a number of tests. The PR is simple enough that it can be trivially rebased and applied once main is fixed. |
My apologies for the combined PR for unrelated issues. I'll try to remember to create the PR from a branch next time. |
By the way, the issue with the tests failing seems to be on line 163 of The actual response received from example.com seems to be 500, though the text in the body of the response reads like a 404. So while the test checks for |
…st_grafana_client_no_verify to not break once params are added in.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #172 +/- ##
==========================================
- Coverage 94.44% 92.26% -2.19%
==========================================
Files 26 27 +1
Lines 1711 1810 +99
==========================================
+ Hits 1616 1670 +54
- Misses 95 140 +45 ☔ View full report in Codecov by Sentry. |
self.assertRaises(GrafanaClientError, lambda: grafana.connect()) | ||
self.assertRaises((GrafanaClientError, GrafanaServerError), lambda: grafana.connect()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, the issue with the tests failing seems to be on line 163 of test_grafana_client.py and the behavior (?) of https://example.org/.
Indeed, example.org, on its /api
endpoint, seems to respond with both 500 and 404 status codes now, specifically with HTTP 500 on /api/health
.
HTTP/1.1 404 Not Found
http HEAD https://example.org/api/foo
http HEAD https://example.org/api/hello
HTTP/1.1 500 Internal Server Error
http HEAD https://example.org/api/bar
http HEAD https://example.org/api/world
http HEAD https://example.org/api/health
It's weird, but c'est la vie, right?
…tally add util to accept and format list-type params.
Dear Chintalagiri, thank you so much for fixing those embarrassing flaws of grafana-client, and for adding new functionality around the User/Teams API endpoint wrapper. Excellent! Keep up that good work, and with kind regards, |
@@ -42,6 +42,7 @@ | |||
AsyncDatasource, | |||
AsyncFolder, | |||
AsyncHealth, | |||
AsyncLibraryElement, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be easy to implement, yes.
There's another option, a bit more straightforward (without generate_async.py): "getattr + module async inspect" on init to check if one api is missing in both sync and async. then raise a warning or error.
regards,
grafana-client 4.1.0 has been released, including your fixes and improvements. Thanks again. NB: Fixing those flaws so diligently and swiftly clearly makes you eligible to be added as a collaborator on this project, so we've just invited you. Feel free to join if that fits your bill. |
Description
Fixes #171
Fixes #173
Fixes #174
Adds a util to format list-type params. Should not break any existing user code, but gives the option to provide such parameter values as a list instead of needing to construct a string of comma separated values.
Checklist