-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix: avoid dbtRunner default callbacks being shared across instances #7279
Conversation
@@ -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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah - reminds me of an all-time classic: https://florimond.dev/en/posts/2018/08/python-mutable-defaults-are-the-source-of-all-evil/
There was a problem hiding this comment.
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!
There was a problem hiding this 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 🙂
Thanks @chamini2! I'm going to merge this, since it already has approval |
…7279) * fix: avoid dbtRunner default callbacks being shared across instances * changie
resolves #7278
Description
default the callbacks argument of dbtRunner to None and create a new list as the default every time it runs.
Checklist
changie new
to create a changelog entry