Conversation
|
I don't see the use case for it YET but I like the beauty of it |
maudetes
left a comment
There was a problem hiding this comment.
So nice!
I absolutely see how this would be useful hihi 🚀
| tmp_file = tempfile.NamedTemporaryFile( | ||
| dir=config.TEMPORARY_DOWNLOAD_FOLDER or None, delete=False | ||
| ) | ||
| async for chunk in request.content.iter_chunked(1024): |
There was a problem hiding this comment.
I think this expects the file as body. Should we use multipart form instead (as is done for file upload) or not?
There was a problem hiding this comment.
As discussed IRL, this should be assessed when we decide the flow of the whole thing (is it called by the browser, by udata...?)
| from udata_hydra import config | ||
|
|
||
|
|
||
| async def analyse_file(request: web.Request) -> web.Response: |
There was a problem hiding this comment.
Do you think we could have a small test? 😛
There was a problem hiding this comment.
Definitely, I am just waiting for the final form to be decided 👹
| delete_resource_exception, | ||
| None, | ||
| ), | ||
| (web.post, "/api/file-analysis/", analyse_file, None), |
There was a problem hiding this comment.
By default, post requests require authentication.
It means that it won't be the user client itself that will call this route, but maybe we want to use udata or cdata api as proxy?
Edit: As discussed, we should discuss the needed workflow, if the call comes from udata, it's fine.
However, if we want the client to use this endpoint with the first rows of its file, we may need to open it.
Just in case we need it somewhen, this is a starting point