-
Notifications
You must be signed in to change notification settings - Fork 92
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
Make the APIDataset.save stores the response received #748
Comments
This is a great point, I think the other slightly more robust way to do this would is to add a |
Ah right I didn't think to this way. In our case, some of the external endpoints send back to us an id and some pieces of information that we use as starting point of another pipeline in a subsequent run so the idea of storing the response. |
That makes sense, I think the ambition is right, we should store this. I guess this was built under the assumption we only cared about |
Great, I will make a PR then. |
It makes total sense to me to save the response. I wouldn't save it as an other type of dataset though (e.g. |
@merelcht I see, regarding the use of When you say
do you mean use directly the |
Sure go for it @MinuraPunchihewa. I see I never got back to the question:
Yes! My point was mainly that I wouldn't import another kedro dataset like |
For your information, I implemented a custom APIDataset with a nested dataset to store the response. I got inspired by the partitioned dataset. I didn't go for the open context manager because I wanted to have flexibility of where I would store the responses: locally, or in s3, in json or in raw text, in a versioned way or not, etc. Also I decided to implement the I'm aware this design is arguable. What I could do is to open a PR as the code is pretty much ready and we discuss this there? I could do the PR by the beginning of next week. If it doesn't fit to the kedro spirit then we can just close it. @merelcht @MinuraPunchihewa What do you think? |
@npfp Please go ahead and open your PR. |
Thanks - @npfp please do! It will be a great place to co-design the best solution possible 💪 |
This is pretty much the design we used for our custom dataset: |
Description
When running a
POST
orPUT
request with theAPIDataset
, the response is currently lost while it would be useful to store it.Context
We rely a lot on the APIDataset to fetch but also to save data to external API. Keeping tracks or the answer is then really important to us.
Possible Implementation
We built a custom
APIDataset
that takes afilepath
argument. If this argument is not None, aTextDataset(filepath=filepath)
is created and is called in the_execute_save_request
:Possible Alternatives
Not found any other.
I would then like to make a PR with this proposed change but before making the actual PR, I wanted to double check with you that this feature would be of interest for the community.
The text was updated successfully, but these errors were encountered: