Skip to content

Conversation

@SamRemis
Copy link
Contributor

@SamRemis SamRemis commented Oct 26, 2025

The ClientGenerator was missing the deepcopy import in generateEventStreamOperation(). Services with only event stream operations fail when smithy-build runs ruff check on the generated code because the generated code calls deepcopy(self._config) without importing it. Non-event-stream operations already had the import.

This adds the missing writer.addStdlibImport("copy", "deepcopy") line.

@SamRemis SamRemis requested a review from a team as a code owner October 26, 2025 22:45

private void generateEventStreamOperation(PythonWriter writer, OperationShape operation) {
writer.pushState(new OperationSection(service, operation));
writer.addStdlibImport("copy", "deepcopy");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding this here, I think we should push this up to the writeSharedOperationInit method

Copy link
Contributor

@jonathan343 jonathan343 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@SamRemis SamRemis merged commit 5b9716d into smithy-lang:develop Oct 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants