-
Notifications
You must be signed in to change notification settings - Fork 95
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
Parse project on target change #1488
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 | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1199,6 +1199,12 @@ export class DBTCoreProjectIntegration | |||||||||||||||||||||||||||||||||||||||||||
(python) => | ||||||||||||||||||||||||||||||||||||||||||||
python!`project.set_defer_config(${deferToProduction}, ${manifestPath}, ${favorState})`, | ||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||
await this.refreshProjectConfig(); | ||||||||||||||||||||||||||||||||||||||||||||
await this.rebuildManifest(); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1202
to
+1204
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. Add error handling for refresh and rebuild operations. The async operations should be wrapped in a try-catch block to handle potential errors consistently with other methods in the class. Apply this diff to add error handling: - await this.refreshProjectConfig();
- await this.rebuildManifest();
+ try {
+ await this.refreshProjectConfig();
+ await this.rebuildManifest();
+ } catch (error) {
+ this.dbtTerminal.error(
+ "dbtCoreIntegration:applyDeferConfig",
+ "An error occurred while refreshing config and rebuilding manifest",
+ error
+ );
+ throw error;
+ } 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
async applySelectedTarget(): Promise<void> { | ||||||||||||||||||||||||||||||||||||||||||||
await this.refreshProjectConfig(); | ||||||||||||||||||||||||||||||||||||||||||||
await this.rebuildManifest(); | ||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+1206
to
1209
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. Improve method implementation with documentation and error handling. The method should include JSDoc documentation and error handling to maintain consistency with other async methods in the class. Apply this diff to improve the implementation: + /**
+ * Applies the selected target by refreshing project configuration and rebuilding manifest.
+ * @throws Error if refresh or rebuild operations fail
+ */
async applySelectedTarget(): Promise<void> {
- await this.refreshProjectConfig();
- await this.rebuildManifest();
+ try {
+ await this.refreshProjectConfig();
+ await this.rebuildManifest();
+ } catch (error) {
+ this.dbtTerminal.error(
+ "dbtCoreIntegration:applySelectedTarget",
+ "An error occurred while applying selected target",
+ error
+ );
+ throw error;
+ }
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
|
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.
Implementation needed for target change handling.
The empty implementation of
applySelectedTarget
could lead to issues with project parsing when the target changes. Based on the PR objectives and the surrounding context, this method should handle the necessary steps to refresh the project configuration and rebuild the manifest when the target changes.Consider implementing the method to: