Fix-16888: sas viya 4 table type error fixes#27222
Fix-16888: sas viya 4 table type error fixes#27222harshsoni2024 wants to merge 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes SAS Viya 4 ingestion failures caused by nullable custom attributes (e.g., casHost=None) and improves resiliency of SAS resourceId parsing/error handling so sink-side failures don’t get masked by source-side exceptions.
Changes:
- Filter
Nonevalues out of SAS table extension attributes before emittingCreateTableRequest. - Harden
create_database_schemaparsing and broaden exception handling to route malformedresourceIdcases to the fallback path. - Add unit tests covering the regression scenarios from #16888 (null extension, sink rejection follow-up, malformed
resourceId, safer exception handler).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ingestion/src/metadata/ingestion/source/database/sas/metadata.py | Drops null custom attributes, avoids None.id masking errors after sink rejection, and improves resourceId parsing/fallback behavior. |
| ingestion/tests/unit/topology/database/test_sas.py | Adds regression-focused unit tests for #16888 across schema parsing, extension filtering, and exception-safety paths. |
Comments suppressed due to low confidence (1)
ingestion/src/metadata/ingestion/source/database/sas/metadata.py:270
- In
create_database_schema, the fallbackexceptblock assumestable["relationships"]exists. Since this method now catchesKeyError/ValueErrorfor malformed inputs, it can still crash with a newKeyErrorwhenrelationshipsis missing (orNone) and we enter the fallback. Please guard withtable.get("relationships")(defaulting to[]) and bail out cleanly (or log) when relationships are absent.
except (HTTPError, IndexError, KeyError, ValueError) as _:
# Find the "database" entity in Information Catalog
# First see if the table is a member of the library through the relationships attribute
# Or we could use views to query the dataStores
data_store_data_sets = "4b114f6e-1c2a-4060-9184-6809a612f27b"
data_store_id = None
for relation in table["relationships"]:
if relation["definitionId"] != data_store_data_sets:
🔴 Playwright Results — 1 failure(s), 33 flaky✅ 3647 passed · ❌ 1 failed · 🟡 33 flaky · ⏭️ 89 skipped
Genuine Failures (failed on all attempts)❌
|
Code Review ✅ Approved 1 resolved / 1 findingsRemoves the redundant ValueError in the SAS Viya 4 table type validation logic, allowing existing IndexError handling to suffice. No issues were found. ✅ 1 resolved✅ Quality: ValueError raise is redundant; IndexError would be caught anyway
OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Describe your changes:
Fixes #16888
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>Summary by Gitar
table_extensionbefore creatingCreateTableRequestto prevent backend rejectioncreate_database_schemato catch malformedresourceIdearlyIndexError,KeyError,ValueErroralongsideHTTPErrorNoneafter yield to skip failed patch/profile callstable_namereference in exception handler by deriving fromtabledict or fallback toidThis will update automatically on new commits.