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

deepcopy args when passed down to rpc pask #3850

Merged
merged 5 commits into from
Sep 10, 2021

Conversation

kwigley
Copy link
Contributor

@kwigley kwigley commented Sep 2, 2021

also resolves #3846

Description

This makes sure that RPC tasks are initialized with a copy of self.args. IF they are mutated further down the call stack, it won't affect the high level RPC process management task and be passed to subsequent RPC tasks.

Checklist

  • I have signed the CLA
  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt next" section.

@cla-bot cla-bot bot added the cla:yes label Sep 2, 2021
@kwigley kwigley force-pushed the kwigley/list-task-fix-take-2 branch 2 times, most recently from 37513e0 to 1312243 Compare September 2, 2021 15:42
@kwigley kwigley force-pushed the kwigley/list-task-fix-take-2 branch from 1312243 to eded923 Compare September 8, 2021 13:41
@kwigley kwigley marked this pull request as ready for review September 8, 2021 14:21
@kwigley kwigley self-assigned this Sep 8, 2021
@gshank
Copy link
Contributor

gshank commented Sep 8, 2021

Do you think we should remove the deepcopy from the RemoteMethod init method in core/dbt/rpc/method.py? I guess it doesn't hurt, but it is an extra copy now.

@kwigley
Copy link
Contributor Author

kwigley commented Sep 8, 2021

Do you think we should remove the deepcopy from the RemoteMethod init method in core/dbt/rpc/method.py? I guess it doesn't hurt, but it is an extra copy now.

@gshank good point, I'll remove it. It can be pretty expensive operation. I also like knowing that the object owns the args passed in, instead of creating a copy in the constructor.

Copy link
Contributor

@nathaniel-may nathaniel-may left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@gshank gshank left a comment

Choose a reason for hiding this comment

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

Looks good!

@kwigley kwigley merged commit 3effade into develop Sep 10, 2021
@kwigley kwigley deleted the kwigley/list-task-fix-take-2 branch September 10, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dbt ls causes dbt deps to fail
3 participants