From 1bcd7e40803fe2ccc41c17a0bdaf2ff651a79495 Mon Sep 17 00:00:00 2001 From: Petr Date: Thu, 12 Mar 2026 15:18:08 +0100 Subject: [PATCH] Fix: URL-decode metric FQN in catalog endpoint FQN can contain spaces (e.g., 'Active2 Customers') which get URL-encoded as 'Active2%20Customers' in the path parameter. Need to decode before passing to OpenMetadata API. --- webapp/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/app.py b/webapp/app.py index 42d3b53..1f228a5 100644 --- a/webapp/app.py +++ b/webapp/app.py @@ -1015,7 +1015,7 @@ def register_routes(app: Flask) -> None: API endpoint to serve metric from OpenMetadata catalog as structured JSON. Args: - metric_fqn: Fully qualified name (e.g., "catalog.metrics.total_revenue") + metric_fqn: Fully qualified name (e.g., "Active2%20Customers" URL-encoded) Returns: JSON matching MetricParser format for modal rendering @@ -1026,8 +1026,12 @@ def register_routes(app: Flask) -> None: return jsonify({"error": "Catalog not available"}), 503 try: + # URL-decode FQN (Flask path parameter already decoded, but just in case) + from urllib.parse import unquote + fqn = unquote(metric_fqn) + # Fetch metric from catalog - raw = _catalog_enricher._client.get_metric_by_fqn(metric_fqn) + raw = _catalog_enricher._client.get_metric_by_fqn(fqn) # Convert to MetricParser format metric_data = _build_om_metric_detail(raw)