Skip to content

Allow sending format with esql.async_query_get #2987

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jetn-ttc
Copy link

The format of received async queries is determined by the async_query_get call, not the async_query (unless it returns immediately). This change allows one to send the format specifier whenever useful. Note that sending format=arrow with a to small completion timeout results in an empty response and no way to get the ID. A more useful strategy is therefore: async_query with no format (or JSON) to get the ID, and only then async_query_get with the received ID and format=arrow.

The format of received async queries is determined by the async_query_get call, not the async_query (unless it returns immediately).
This change allows one to send the format specifier whenever useful.
Note that sending format=arrow with a to small completion timeout results in an empty response and no way to get the ID.
A more useful strategy is therefore: async_query with no format (or JSON) to get the ID, and only then async_query_get with the received ID and format=arrow.
Copy link

cla-checker-service bot commented Jun 20, 2025

💚 CLA has been signed

@miguelgrinberg
Copy link
Contributor

Hi @jetn-ttc, thanks for your PR!

The file that you edited is auto-generated directly from the Elasticsearch specification. It appears that we do not have format listed as a valid query parameter for the GET method of this endpoint, just for POST.

I'm not super familiar with the ES|QL endpoints myself, so we need to find out if the specification is wrong, and in that case the fix needs to be made there, so that then all our clients, documentation and other projects that derive from the spec are updated accordingly.

@jetn-ttc
Copy link
Author

I see ! It does seem somewhat generated now you say it :-D

I can see from my own modifications that it works (on 8.18.1 at least).

Testing with curl and the same workflow shows the ID you need is actually also sent in the header, so the server might be ok it's only the python code that doesn't take that into consideration. I'll perhaps just open an issue on the repo you linked.

@miguelgrinberg
Copy link
Contributor

Yes, I have checked internally and this does seem to be an omission in the specification, so I'll add format there. Feel free to write an issue on that repo if you like to track this work over there. Thanks!

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