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

fix: avoid dbtRunner default callbacks being shared across instances #7279

Merged
merged 2 commits into from
Apr 11, 2023

Conversation

chamini2
Copy link
Contributor

@chamini2 chamini2 commented Apr 5, 2023

resolves #7278

Description

default the callbacks argument of dbtRunner to None and create a new list as the default every time it runs.

Checklist

@chamini2 chamini2 requested a review from a team as a code owner April 5, 2023 16:45
@cla-bot cla-bot bot added the cla:yes label Apr 5, 2023
@chamini2 chamini2 changed the title Matteo/fix dbt runner callbacks default fix: avoid dbtRunner default callbacks being shared across instances Apr 5, 2023
@@ -40,11 +40,14 @@ def __init__(
project: Project = None,
profile: Profile = None,
manifest: Manifest = None,
callbacks: List[Callable[[EventMsg], None]] = [],
callbacks: List[Callable[[EventMsg], None]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have all been caught by it at some point!

Copy link
Contributor

@QMalcolm QMalcolm left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for catching this and also going about fixing it 🙂

@jtcohen6
Copy link
Contributor

Thanks @chamini2! I'm going to merge this, since it already has approval

@jtcohen6 jtcohen6 merged commit 7a4d3bd into dbt-labs:main Apr 11, 2023
emmyoop pushed a commit that referenced this pull request Apr 11, 2023
…7279)

* fix: avoid dbtRunner default callbacks being shared across instances

* changie
@chamini2 chamini2 deleted the matteo/fix-dbtRunner-callbacks-default branch April 11, 2023 14:29
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.

[CT-2375] [Bug] dbtRunner instances share the callbacks across instances when no callbacks are passed
4 participants