Repository navigation
Fixes 25420: Alation Sink no longer crashes at the end of a run and surfaces Alation's errors - #36066
Conversation
…urfaces Alation's errors _iter never yielded, so Source.run iterated None and every run ended in 'NoneType' object is not iterable. APIError read error["message"], which Alation error bodies lack, so a rejected write logged only 'message'. Rejected writes are now recorded on the status instead of passing silently.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
harshsoni2024
left a comment
There was a problem hiding this comment.
The crash and immediate error handling fixes look useful. I found one remaining gap before merge:
- Alation’s schema, table, and column POSTs return asynchronous job IDs. A truthy response means the upload was accepted, but the job can later reject objects. Please check the job result before marking the write successful.
Schema, table and column writes return a job id; a failed job, or the per-object errors of a successful one, is now recorded on the status instead of the job id counting as success. Writes are batched at 1000, the default of Alation's own SDK. Also read the created datasource's id from the response dict, which the no-datasourceLinks path never could.
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Use lazy logging for the new write logs and prune the two G004 baseline entries for the f-string logs they replaced.
| deadline = time.monotonic() + JOB_TIMEOUT_SECONDS | ||
| interval = JOB_POLL_INITIAL_INTERVAL_SECONDS | ||
| while True: | ||
| job = self.jobs_client.get("/bulk_metadata/job/", data={"id": job_id}) or {} |
There was a problem hiding this comment.
_wait_for_job checks its deadline only after the GET returns. Each poll uses the REST client's default 300-second read timeout and retries, so a poll started just before the deadline can hold up the run for several more minutes. Check the remaining time before each poll and limit the request timeout and retries to that budget.
Check the job deadline before every poll and never sleep past it, and give the job client a 30s read timeout with no retries, so a wait overruns its timeout by at most one poll. State the five-error cap on the run status in the decision record.
With retries off, one 5xx or timed-out poll failed a batch whose job may still succeed. A transient failure (transport, 429, 5xx) is now retried by the next poll until the deadline, reported with the last poll error; any other failure still fails the batch at once.
Index ROUTES directly, pass hostPort to clean_uri as a string, and read a job poll only when it decoded to a dict. ingest_tables now keeps the tables that pass the filter instead of filtering again before the column writes, which also stops a filtered table being counted twice on the status.
Code Review ✅ Approved 2 closed / 2 findings🟡 Medium risk · Batching Alation metadata writes and adding job polling changes delivery semantics; timeout or response mismatches could leave records incomplete or flag successful writes. Fixes the Alation Sink end-of-run crash by ending the source iterator with ✅ 2 closed✅ Quality: MAX_REPORTED_ERRORS cap of 5 is a new limit not stated in the ADR
✅ Bug: retry=0 makes one transient poll error fail a batch that may succeed
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…ce and routes lineage by project (#37855) * Fixes #37777: MicroStrategy skips documents, parses cube SQL once and routes lineage by project (#37778) * MicroStrategy: skip documents, parse cube SQL once, dedupe columns - Tell Report Services documents, templates and themes from dossiers by viewMedia (the rule MicroStrategy's mstrio-py SDK uses) and skip them before reading a definition the dossier API cannot serve. - Parse each cube's SQL once per cube and dialect instead of once per dbServicePrefixes entry and dossier; skip a prefix whose database does not match the table's qualifier. - Give repeated data model column names a suffix, and drop a repeated object. - Say when a dataset is a report rather than a cube. * MicroStrategy: suffix repeated column names in id order A dataset can list its objects in another order on a later run; suffixes given in listing order would then move a column name to another object. (cherry picked from commit e994f52) * ingestion: read an API error without a message key MicroStrategy answers some errors with only code and ticketId, and APIError raised KeyError: 'message' while being built. Backports the fallback main has had since #36066. * MicroStrategy: bound the service lookup caches The dialect and database-name caches are now LRUs capped at CACHE_SIZE, like the connector's other caches, and database names are read with model_str.



Describe your changes:
Fixes #25420
Client-side bugs in the Alation Sink connector; none involve the OpenMetadata server:
AlationsinkSource._iternever yielded, so it returnedNoneandSource.runfailed with'NoneType' object is not iterableafter all writes had finished. It now ends withyield from ().Failed to write entities: 'message'. Alation error bodies carrycode/detailand nomessage, soAPIError.__init__raisedKeyErrorand dropped Alation's explanation. It now falls back todetail, thentitle, then the whole body.job_id; the sink took that as success. Each write now polls/api/v1/bulk_metadata/job/until the job finishes (timeout = failure), and afailedjob or the per-objecterrorsof asuccessfulone are recorded on the status with Alation's message.datasourceLinks, the created datasource's id was read as an attribute of a dict, so that path could never work.Record:
ADR:2026-10-23-alation-sink-writes-in-batches-and-waits-for-each-job.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
Unhandledfailure.APIErrorbuilt from a body withoutmessagereportsdetail/title.Unit tests
alationsink/test_client.py,alationsink/test_metadata.py,ometa/test_api_error.py. Each fails against the code before its fix.Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
Alation can't run locally, so each run below writes to a fake Alation server that returns Alation-shaped responses.
code/title/detailand nomessage.detail, and the status names the rejected table.MetadataWorkflow(CLI path), fake Alation answering with jobs (running, then the outcome):NoneTypeand never checked jobs.APIError, REST client resilience, ometa restore and dbt config errors.Not tested: real Alation. Job shapes and the batch size come from Alation's SDK and docs.
UI screen recording:
Not applicable — ingestion-only bug fix.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.REVIEW.mdand fixed every 🔴 finding.ADR:2026-10-23-alation-sink-writes-in-batches-and-waits-for-each-job.🤖 Generated with Claude Code
Summary by Gitar
WRITE_BATCH_SIZE(1000)/bulk_metadata/job/is polled with backoff until done, failing afterJOB_TIMEOUT_SECONDS2026-10-23-alation-sink-writes-in-batches-and-waits-for-each-job.mdThis will update automatically on new commits.


Confidence Score: 5/5
The PR appears safe to merge, with a remaining non-blocking concern about the job timeout.Findings
Summary
The Alation Sink now writes in batches and waits for Alation jobs before continuing.
messageis missing.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Schema, table, or column requests] --> B[Split into batches of 1000] B --> C[Post batch to Alation] C --> D{Job returned?} D -->|Yes| E[Poll until finished or timed out] D -->|No| F[Use immediate response] E --> G[Collect job and object errors] F --> G G --> H[Record failures and continue]Reviews (7) · Last reviewed commit: "Merge branch 'main' into fix/25420-alati..." · Reviewed by Greptile