You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have read Caveats documentation and didn't find a solution for this problem there.
Bug description
Attached sample does not work
I have also tried several permutations on Readable and fs.ReadStream
Q is unable to help. Q seems to think that my code ought to work.
Here is the error it produces:
Type 'SdkStream<ReadableStream | Blob> | SdkStream<Readable>' is not assignable to type 'StreamingBlobPayloadOutputTypes | undefined'.
Type 'ReadableStream & SdkStreamMixin' is not assignable to type 'StreamingBlobPayloadOutputTypes | undefined'.
Type 'ReadableStream & SdkStreamMixin' is not assignable to type 'Readable & SdkStreamMixin'.
Type 'ReadableStream & SdkStreamMixin' is missing the following properties from type 'Readable': readable, readableEncoding, readableEnded, readableFlowing, and 33 more.ts(2322)
(property) Body?: StreamingBlobPayloadOutputTypes | undefined
Reproduction
import { mockClient } from "aws-sdk-client-mock";
import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
import { sdkStreamMixin } from "@smithy/util-stream";
import fs from "node:fs";
import { Readable } from "node:stream";
const s3ClientMock = mockClient(S3Client);
const trainingData = fs.createReadStream(
__dirname + "path/to/file.csv",
"utf8"
);
describe("oversampleTraining", () => {
beforeEach(() => {
s3ClientMock.reset();
});
it("oversamples the training data", () => {
s3ClientMock.on(GetObjectCommand).resolves({
Body: sdkStreamMixin(Readable.from(trainingData)),
});
});
});
Environment
Node version: using bb app -v :: 8.19.4
Testing lib and version: "jest": "^29.4.3",
Typescript version: "~4.7.4"
AWS SDK v3 Client mock version: "^3.1.0"
AWS JS SDK libs and versions:
"@aws-sdk/client-s3": "^3.515.0",
The text was updated successfully, but these errors were encountered:
Checklist
Bug description
Attached sample does not work
Readable
andfs.ReadStream
Here is the error it produces:
Reproduction
Environment
bb app -v
:: 8.19.4The text was updated successfully, but these errors were encountered: