-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(mssql): harden error handling and observability across throttling, description maps, and unguarded query paths #31884
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: main
Are you sure you want to change the base?
Changes from all commits
f29be7b
507fc12
b59c58a
48d2a51
f990cac
e88579b
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 |
|---|---|---|
|
|
@@ -210,7 +210,7 @@ def _load_description_maps(self) -> None: | |
| load_description_map() | ||
| except Exception as exc: | ||
| logger.debug(traceback.format_exc()) | ||
| logger.debug(f"Could not load MSSQL {description_type} descriptions, continuing without them: {exc}") | ||
| logger.warning(f"Could not load MSSQL {description_type} descriptions, continuing without them: {exc}") | ||
|
Comment on lines
211
to
+213
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. 💡 Quality: WARNING on description-map failure may be noisy under ingestAllDatabasesEscalating the description-map load failure from DEBUG to WARNING (metadata.py:213) improves visibility, but under Was this helpful? React with 👍 / 👎 |
||
|
|
||
| def get_database_names(self) -> Iterable[str]: | ||
| if not self.config.serviceConnection.root.config.ingestAllDatabases: # pyright: ignore[reportAttributeAccessIssue] | ||
|
|
@@ -252,15 +252,25 @@ def get_database_names(self) -> Iterable[str]: | |
| def get_stored_procedures(self) -> Iterable[MssqlStoredProcedure]: | ||
| """List Snowflake stored procedures""" | ||
| if self.source_config.includeStoredProcedures: | ||
| with self.engine.connect() as conn: | ||
| results = conn.execute( | ||
| text( | ||
| MSSQL_GET_STORED_PROCEDURES.format( | ||
| database_name=self.context.get().database, | ||
| schema_name=self.context.get().database_schema, | ||
| schema_name = self.context.get().database_schema # pyright: ignore[reportAttributeAccessIssue] | ||
| try: | ||
| with self.engine.connect() as conn: | ||
| results = conn.execute( | ||
| text( | ||
| MSSQL_GET_STORED_PROCEDURES.format( | ||
| database_name=self.context.get().database, # pyright: ignore[reportAttributeAccessIssue] | ||
| schema_name=schema_name, | ||
| ) | ||
| ) | ||
| ) | ||
| ).all() | ||
| ).all() | ||
| except Exception as exc: | ||
| logger.debug(traceback.format_exc()) | ||
| logger.warning(f"Error listing stored procedures for schema {schema_name}: {exc}") | ||
| self.status.warning( | ||
| schema_name, | ||
| f"Error listing stored procedures for schema {schema_name}: {exc}", | ||
| ) | ||
| return | ||
| for row in results: | ||
| try: | ||
| stored_procedure = MssqlStoredProcedure.model_validate(row._asdict()) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.