feat: allow passing a stream to KeyValueStore.setRecord#1325
feat: allow passing a stream to KeyValueStore.setRecord#1325B4nan merged 5 commits intoapify:masterfrom
KeyValueStore.setRecord#1325Conversation
|
What about some tests? :] |
There was a problem hiding this comment.
The underlying setRecord call already supports streams and I think it even validates them. I would skip the extra dependency and just relax the validation here in the SDK so that streams pass it. Or replicate the validation in the client, so that we don't get two different validations.
But a test would be nice anyway! 😄
|
Of course. Added tests. First wanted to discuss the matter :) @mnmkng I feel the test is required as some restrictions are being applied to contentType for other value types (which I think is to allow saving objects as JSON without providing contentType). Client lib implementation for reference: https://github.com/apify/apify-client-js/blob/master/src/resource_clients/key_value_store.ts |
|
Nice timing, I am also waiting for this PR. |
KeyValueStore.setRecord
|
@B4nan This should be fixed. I like it better that way too 👍 |
|
Not that it would matter much in here (given how small the PR is), but please dont rebase after you get a review, so we can see what you changed. We will squash merge the PR, so there will be just a single commit in master (and will have the commit message based on PR title). |
|
Weird, tests started to fail? Hard to say why as I dont see what you changed because of the rebase :P |
|
Always beautiful when all lights turn 🟢 😎 |

Right now the only way for a stream to be save in a KV store is using a buffer but (correct me if I'm wrong), that would mean using the memory (while passing the stream would directly send it via the network to the s3 bucket).
Current working solution:
The PR would let us do:
Thoughts?
We uncovered this issue while working on a project with @levent91.