You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Fixesopen-metadata#31459: actionable errors when the OMeta client cannot start
Every workflow starts with GET /system/version. When that call did not
return the expected JSON, the client returned the raw `Response` as if it
were the decoded body, and the user got `TypeError: 'Response' object is
not subscriptable` several frames from the real misconfiguration.
Name each failure mode instead:
- HTML body (hostPort missing `/api`, so the request hit the UI catch-all)
now raises `HtmlResponseError` from the client itself, since no endpoint
legitimately answers HTML. CSV and ODCS-YAML exports still get their
`Response` back.
- `get_server_version` reads the raw response and classifies 401/403, 404,
other non-2xx, non-JSON bodies, a missing `version` field and an
exhausted retry budget, each naming the URL actually called.
- The version mismatch message now carries the remedy (which client
version to install).
- `create_ometa_client` keeps the exception class, the host and the cause
instead of flattening everything into `ValueError(str)`.
- `health_check` reuses `get_server_version` rather than repeating the
same unguarded subscript.
`OMetaClientInitError` subclasses `ValueError` so existing callers keep
working. Drops the two subscript errors this fixes from the basedpyright
baseline.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Address review: keep the HTML error provider-neutral in REST
Two findings on open-metadata#31461.
IceS2: `REST` is not OpenMetadata-specific — around 25 connectors import it
to call third-party APIs — so an HTML login page from, say, Superset would
have told the user to add `/api` to `hostPort`. The message raised by the
client is now provider-neutral, and callers that know which API they were
talking to pass a `hint`. `server_mixin`, which does know the target is an
OpenMetadata server, supplies the `hostPort`/`/api` advice.
gitar-bot: `_read_version` sniffed HTML with a bare `startswith("<")` while
the client also required an `<html` tag, so an XML or SVG error page was
reported as a UI page with a misleading hint. Both paths now share the
helper, promoted to `is_html_body`.
Adds tests for the neutral client message and for an XML body reaching the
"not JSON" branch rather than the HTML one.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* Make the HTML-response error opt-in per client
CI caught the real cost of raising from the transport layer:
test_ingestion_get_version_still_tolerates_a_non_json_reply failed because
`AirflowApiClient` shares this `REST` class and deliberately splits its two
paths — `get_version` (ingestion) parses a bad body to `{}`, while
`test_get_version` (connection gate) is strict via `get_raw`. Raising on
HTML broke the lenient one, which is exactly what that test guards.
Add `ClientConfig.raise_on_html`, default False, and set it only where the
OpenMetadata client is built. The OpenMetadata API never answers HTML, so
the guard still covers its endpoints; the ~20 connectors that construct
their own `ClientConfig` keep the behaviour they had.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments