-
Notifications
You must be signed in to change notification settings - Fork 112
Fix profile change not updating target #1665
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -492,10 +492,11 @@ export class DBTCoreProjectIntegration | |||||||||||||||||||
); | ||||||||||||||||||||
this.disposables.push( | ||||||||||||||||||||
dbtProfileWatcher, | ||||||||||||||||||||
// when the project config changes we need to re-init the dbt project | ||||||||||||||||||||
...setupWatcherHandler(dbtProfileWatcher, () => | ||||||||||||||||||||
this.rebuildManifest(), | ||||||||||||||||||||
), | ||||||||||||||||||||
// when the profile changes we need to refresh the project configuration | ||||||||||||||||||||
...setupWatcherHandler(dbtProfileWatcher, async () => { | ||||||||||||||||||||
await this.refreshProjectConfig(); | ||||||||||||||||||||
await this.rebuildManifest(); | ||||||||||||||||||||
Comment on lines
+497
to
+498
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding a try/catch block inside the async watcher callback to handle potential errors from
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||
}), | ||||||||||||||||||||
Comment on lines
+496
to
+499
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [nitpick] Extract the inline async callback into a named method (e.g.,
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||||||||||||||||
); | ||||||||||||||||||||
} | ||||||||||||||||||||
await this.createPythonDbtProject(this.python); | ||||||||||||||||||||
|
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.
Consider adding error handling (e.g. a
try-catch
) inside the async watcher callback to log or handle failures fromrefreshProjectConfig
orrebuildManifest
. This avoids unhandled promise rejections if one of these operations fails.