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

Provide function to set the invocation_id #4351

Merged
merged 1 commit into from
Nov 29, 2021
Merged

Provide function to set the invocation_id #4351

merged 1 commit into from
Nov 29, 2021

Conversation

gshank
Copy link
Contributor

@gshank gshank commented Nov 29, 2021

resolves #4337

Description

This adds a 'set_invocation_id' function for use of the dbt rpc server.

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

@@ -324,3 +324,10 @@ def get_invocation_id() -> str:
if invocation_id is None:
invocation_id = str(uuid.uuid4())
return invocation_id


def set_invocation_id() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to have it return the invocation id instead of None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about that, but the way it's used, not really. Other code gets the current invocation_id from the 'get_invocation_id' function, and that will stay the same, so we're just changing it in the spawned copy of the code for the places where get_invocation_id is used.

@gshank gshank merged commit 4eb17b5 into main Nov 29, 2021
@gshank gshank deleted the set_invocation_id branch November 29, 2021 15:15
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.

Ensure that all dbt invocations have an invocation_id
2 participants