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

experimental: adjust the query client interface, remove unused code #1211

Closed
wants to merge 1 commit into from

Conversation

gabor
Copy link
Contributor

@gabor gabor commented Jan 30, 2025

changes to certain structures in experimental:

Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

the 3 prs look good, I think we can probably put them all together? But yeah seems like a good improvement!

func NewErrorQDR(req QueryDataRequest, err error) *backend.QueryDataResponse {
qdr := backend.NewQueryDataResponse()
for _, q := range req.Queries {
qdr.Responses[q.RefID] = backend.ErrDataResponse(backend.StatusBadRequest, err.Error())
Copy link
Member

Choose a reason for hiding this comment

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

I think it's weird that the existing code did this btw... like what if the status code from the response was a 429 it would get lost kind of? But also my understanding is maybe that's already happening so i guess ok to keep it? haha.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i admit, we kind of rely on knowing (or thinking that we know 😁 ) the possible http-codes.
i did some digging for how /api/ds/query does this, and it's like this:

so in short, if we have a QDR, then it's http400 or http200, if we don't have a QDR, we check for maybe-http404, some auth-cases, else http500 😄

... of course it's still possible that we'll find a scenario that we cannot represent with the current approach 😿 , i guess then we go back to the drawing board again..

@gabor gabor force-pushed the gabor/query-client-change branch from 50b1c76 to 84e1084 Compare January 31, 2025 10:23
@gabor gabor force-pushed the gabor/query-client-change branch from 84e1084 to aef7827 Compare January 31, 2025 10:48
@gabor gabor marked this pull request as ready for review January 31, 2025 10:49
@gabor gabor requested a review from a team as a code owner January 31, 2025 10:49
@gabor gabor requested review from wbrowne, andresmgot and oshirohugo and removed request for a team January 31, 2025 10:49
@gabor
Copy link
Contributor Author

gabor commented Jan 31, 2025

will use a different approach, closing for now

@gabor gabor closed this Jan 31, 2025
@gabor gabor deleted the gabor/query-client-change branch February 3, 2025 08:10
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.

2 participants