Skip to content
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

[Bug]: No transformation for getObject(params).createReadStream() #862

Open
1 task
trivikr opened this issue Apr 12, 2024 · 1 comment
Open
1 task

[Bug]: No transformation for getObject(params).createReadStream() #862

trivikr opened this issue Apr 12, 2024 · 1 comment
Labels
bug Something isn't working p2 This is a standard priority issue

Comments

@trivikr
Copy link
Member

trivikr commented Apr 12, 2024

Self-service

  • I'd be willing to implement a fix

Describe the bug

No transformation for getObject(params).createReadStream()

Steps to reproduce

import { S3 } from "aws-sdk";
import { Readable } from "stream";

const client = new S3({ region: "us-west-2" });
const response: Readable = client
  .getObject({ Bucket: "my-bucket", Key: "my-key" })
  .createReadStream();

Observed behavior

import { S3 } from "@aws-sdk/client-s3";
import { Readable } from "stream";

const client = new S3({
  region: "us-west-2"
});
const response: Readable = client
  .getObject({ Bucket: "my-bucket", Key: "my-key" })
  .createReadStream();

This is an issue since createReadStream does not exist on getObject in v3.

Expected behavior

import { S3 } from "aws-sdk";
import { Readable } from "stream";

const client = new S3({ region: "us-west-2" });
const response: Readable = (await client
  .getObject({ Bucket: "my-bucket", Key: "my-key" }))
  .Body;

Environment

aws-sdk-js-codemod: 1.3.6
- jscodeshift: 0.15.2
- recast: 0.23.4

Additional context

@trivikr trivikr added bug Something isn't working triage Triaging bugs p2 This is a standard priority issue and removed triage Triaging bugs labels Apr 12, 2024
@trivikr trivikr removed the triage Triaging bugs label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

1 participant