This is an automated email from the ASF dual-hosted git repository.
jerryshao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new adb22d3d4a [#14207] feat(mcp-server): Support Semantic Model metric
discovery (#14208)
adb22d3d4a is described below
commit adb22d3d4a20dc5283b1c7b7863c1df131e3eb90
Author: mchades <[email protected]>
AuthorDate: Thu Oct 29 17:28:44 2026 +0800
[#14207] feat(mcp-server): Support Semantic Model metric discovery (#14208)
### What changes were proposed in this pull request?
Add `list_metrics` and `list_metric_infos` under the `semantic_model`
tool tag. Each tool makes one schema-level REST request and retains full
namespaces and complete metric definitions.
Add decimal-preserving response decoding, strict list-response
validation, read-only annotations, tests, and usage documentation.
### Why are the changes needed?
Allow MCP callers to discover metrics without loading each Semantic
Model, following #14038 under #14036.
Rebased onto `main` after #14143 merged. This PR now contains only the
MCP implementation and its tests and documentation.
Fixes #14207.
### Does this PR introduce _any_ user-facing change?
Adds two read-only tools accepting `catalog_name`, `schema_name`, and
optional per-call `metalake`. Results preserve REST namespaces and JSON
number precision; server and malformed-response errors propagate to
callers.
### How was this patch tested?
On the rebased branch, 301 MCP unit tests and 12 integration tests
passed, including four metric-discovery scenarios against live MCP and
Gravitino servers with authorization enabled.
- `uv run --locked python -m unittest discover -s tests -v` from
`mcp-server`.
- `./gradlew compileDistribution -x test -PskipWeb=true`.
- `GRAVITINO_HOME=<built distribution> bash
dev/run_authz_integration_test.sh` from `mcp-server`.
- Black, isort, Pylint, and `git diff --check` passed.
---
docs/gravitino-mcp-server.md | 24 +-
.../plain_rest_client_semantic_model_operation.py | 24 ++
mcp-server/mcp_server/client/plain/utils.py | 37 ++-
.../mcp_server/client/semantic_model_operation.py | 12 +
mcp-server/mcp_server/tools/semantic_model.py | 74 ++++-
mcp-server/pyproject.toml | 2 +
.../test_semantic_model_metric_discovery.py | 343 +++++++++++++++++++++
mcp-server/tests/unit/client/test_utils.py | 63 ++++
mcp-server/tests/unit/tools/mock_operation.py | 8 +
mcp-server/tests/unit/tools/test_semantic_model.py | 225 +++++++++++++-
mcp-server/uv.lock | 63 ++++
11 files changed, 863 insertions(+), 12 deletions(-)
diff --git a/docs/gravitino-mcp-server.md b/docs/gravitino-mcp-server.md
index 086e744a6a..c07bee1615 100644
--- a/docs/gravitino-mcp-server.md
+++ b/docs/gravitino-mcp-server.md
@@ -139,6 +139,8 @@ Gravitino MCP server supports the following tools, and you
could export tool by
| `list_of_views` | Retrieve a list of views for a schema.
Only for catalogs supporting views. | `view` |
| `load_view` | Retrieve a view's metadata. Only for
catalogs supporting views. | `view` |
| `list_of_semantic_models` | List the Semantic Models the caller
can access in a schema. | `semantic_model` |
+| `list_metrics` | List visible metric identifiers across
Semantic Models in a schema. | `semantic_model` |
+| `list_metric_infos` | List complete visible metrics across
Semantic Models in a schema. | `semantic_model` |
| `load_semantic_model` | Load a Semantic Model's metadata and
definition. | `semantic_model` |
| `create_semantic_model` | Create a Semantic Model from a native
REST definition. | `semantic_model` |
| `alter_semantic_model` | Apply Semantic Model updates
atomically. | `semantic_model` |
@@ -149,12 +151,30 @@ Gravitino MCP server supports the following tools, and
you could export tool by
Semantic Model tools manage schema-scoped semantic metadata through the
Gravitino REST API.
For concepts and source requirements, see [Semantic
Models](./semantic-models.md). For governance
and Ossie import/export, see [Manage Semantic Model
Metadata](./manage-semantic-model-metadata-using-gravitino.md).
-Use the `semantic_model` tag with `--include-tool-tags` to expose these five
tools.
+Use the `semantic_model` tag with `--include-tool-tags` to expose these tools.
They use the same per-call `metalake` selection and authentication as other
tools;
-Gravitino filters listings and enforces authorization, including access to
referenced source tables.
+Gravitino filters listings by visibility and checks source-table access when
creating or
+replacing definitions.
Names used in REST paths must be non-empty and cannot be `.` or `..`, which
HTTP clients
normalize as path navigation. Names must also satisfy the server's naming
rules.
+`list_metrics` and `list_metric_infos` discover metrics across a schema with
one
+REST request per call. Both accept `catalog_name`, `schema_name`, and the
optional
+per-call `metalake`. For example:
+
+```json
+{"metalake": "prod", "catalog_name": "sales", "schema_name": "mart"}
+```
+
+`list_metrics` returns a JSON array of identifiers whose `namespace` is
+`[metalake, catalog, schema, semanticModel]` and whose `name` is the exact
metric
+name. `list_metric_infos` returns objects with the same full `namespace` and a
+complete `metric`, including its name, expression, and optional description,
+datatype, AI context, and custom extensions. JSON number precision is
preserved.
+Both modes follow containing-model visibility and sort by model identifier,
then
+case-sensitive metric name. An empty result is `[]`; failures propagate as tool
+errors. These tools discover definitions and do not execute metric queries.
+
For example, call `create_semantic_model` with the following arguments after
the
`sales.mart.orders` source table exists in the selected metalake:
diff --git
a/mcp-server/mcp_server/client/plain/plain_rest_client_semantic_model_operation.py
b/mcp-server/mcp_server/client/plain/plain_rest_client_semantic_model_operation.py
index d02b80514d..b57c7472d8 100644
---
a/mcp-server/mcp_server/client/plain/plain_rest_client_semantic_model_operation.py
+++
b/mcp-server/mcp_server/client/plain/plain_rest_client_semantic_model_operation.py
@@ -22,6 +22,7 @@ from httpx import AsyncClient
from mcp_server.client.plain.utils import (
encode_path_segment,
extract_content_from_response,
+ extract_list_from_response,
)
from mcp_server.client.semantic_model_operation import SemanticModelOperation
@@ -41,6 +42,22 @@ class
PlainRESTClientSemanticModelOperation(SemanticModelOperation):
)
return extract_content_from_response(response, "identifiers", [])
+ async def list_metrics(self, catalog_name: str, schema_name: str) -> str:
+ response = await self.rest_client.get(
+ self._metrics_path(catalog_name, schema_name),
+ params={"details": "false"},
+ )
+ return extract_list_from_response(response, "identifiers")
+
+ async def list_metric_infos(
+ self, catalog_name: str, schema_name: str
+ ) -> str:
+ response = await self.rest_client.get(
+ self._metrics_path(catalog_name, schema_name),
+ params={"details": "true"},
+ )
+ return extract_list_from_response(response, "metrics")
+
async def load_semantic_model(
self, catalog_name: str, schema_name: str, semantic_model_name: str
) -> str:
@@ -97,6 +114,13 @@ class
PlainRESTClientSemanticModelOperation(SemanticModelOperation):
f"/schemas/{encode_path_segment(schema_name)}/semantic-models"
)
+ def _metrics_path(self, catalog_name: str, schema_name: str) -> str:
+ return (
+ f"/api/metalakes/{encode_path_segment(self.metalake_name)}"
+ f"/catalogs/{encode_path_segment(catalog_name)}"
+
f"/schemas/{encode_path_segment(schema_name)}/semantic-model-metrics"
+ )
+
def _model_path(
self, catalog_name: str, schema_name: str, semantic_model_name: str
) -> str:
diff --git a/mcp-server/mcp_server/client/plain/utils.py
b/mcp-server/mcp_server/client/plain/utils.py
index 298c89170e..7d3d53538f 100644
--- a/mcp-server/mcp_server/client/plain/utils.py
+++ b/mcp-server/mcp_server/client/plain/utils.py
@@ -15,10 +15,12 @@
# specific language governing permissions and limitations
# under the License.
-import json
import logging
+from decimal import Decimal
from urllib.parse import quote
+import simplejson
+
from mcp_server.client.plain.exception import GravitinoException
@@ -32,15 +34,40 @@ def encode_path_segment(segment: str) -> str:
def extract_content_from_response(response, field: str, default="") -> str:
- response_json = response.json()
+ response_json = response.json(parse_float=Decimal)
_handle_gravitino_exception(response_json)
- return json.dumps(response_json.get(field, default))
+ return simplejson.dumps(response_json.get(field, default),
use_decimal=True)
+
+
+def extract_list_from_response(response, field: str) -> str:
+ """Extract a required JSON array without rounding fractional numbers.
+
+ Propagate server errors and reject malformed envelopes instead of returning
+ an empty result for a failed discovery request.
+ """
+ try:
+ payload = simplejson.loads(response.content, use_decimal=True)
+ except (simplejson.JSONDecodeError, UnicodeDecodeError) as exc:
+ response.raise_for_status()
+ raise GravitinoException(
+ "Invalid Gravitino response: invalid JSON"
+ ) from exc
+ if isinstance(payload, dict):
+ _handle_gravitino_exception(payload)
+ response.raise_for_status()
+ if not isinstance(payload, dict) or "code" not in payload:
+ raise GravitinoException("Invalid Gravitino response: missing code")
+ if not isinstance(payload.get(field), list):
+ raise GravitinoException(
+ f"Invalid Gravitino response: {field} must be a JSON array"
+ )
+ return simplejson.dumps(payload[field], use_decimal=True)
def extract_response(response) -> str:
- response_json = response.json()
+ response_json = response.json(parse_float=Decimal)
_handle_gravitino_exception(response_json)
- return json.dumps(response_json)
+ return simplejson.dumps(response_json, use_decimal=True)
def _handle_gravitino_exception(response: dict):
diff --git a/mcp-server/mcp_server/client/semantic_model_operation.py
b/mcp-server/mcp_server/client/semantic_model_operation.py
index deeb83cf30..9d3572f2a4 100644
--- a/mcp-server/mcp_server/client/semantic_model_operation.py
+++ b/mcp-server/mcp_server/client/semantic_model_operation.py
@@ -29,6 +29,18 @@ class SemanticModelOperation(ABC):
"""Return Semantic Model identifiers as a JSON array."""
pass
+ @abstractmethod
+ async def list_metrics(self, catalog_name: str, schema_name: str) -> str:
+ """Return visible metric identifiers with full REST namespaces as
JSON."""
+ pass
+
+ @abstractmethod
+ async def list_metric_infos(
+ self, catalog_name: str, schema_name: str
+ ) -> str:
+ """Return complete visible metrics and their full namespaces as
JSON."""
+ pass
+
@abstractmethod
async def load_semantic_model(
self, catalog_name: str, schema_name: str, semantic_model_name: str
diff --git a/mcp-server/mcp_server/tools/semantic_model.py
b/mcp-server/mcp_server/tools/semantic_model.py
index 2a5353508a..58eb1e50dc 100644
--- a/mcp-server/mcp_server/tools/semantic_model.py
+++ b/mcp-server/mcp_server/tools/semantic_model.py
@@ -18,10 +18,16 @@
from typing import Optional
from fastmcp import Context, FastMCP
+from mcp.types import ToolAnnotations
def load_semantic_model_tools(mcp: FastMCP):
- @mcp.tool(tags={"semantic_model"})
+ @mcp.tool(
+ tags={"semantic_model"},
+ annotations=ToolAnnotations(
+ readOnlyHint=True, destructiveHint=False, idempotentHint=True
+ ),
+ )
async def list_of_semantic_models(
ctx: Context, catalog_name: str, schema_name: str
) -> str:
@@ -43,7 +49,71 @@ def load_semantic_model_tools(mcp: FastMCP):
)
)
- @mcp.tool(tags={"semantic_model"})
+ @mcp.tool(
+ tags={"semantic_model"},
+ annotations=ToolAnnotations(
+ readOnlyHint=True, destructiveHint=False, idempotentHint=True
+ ),
+ )
+ async def list_metrics(
+ ctx: Context, catalog_name: str, schema_name: str
+ ) -> str:
+ """List visible metric identifiers across the Semantic Models in a
schema.
+
+ Gravitino applies containing-model visibility and sorts by model
+ identifier, then case-sensitive metric name. Models without metrics
+ contribute no entries.
+
+ Args:
+ ctx: The request context.
+ catalog_name: Name of the catalog.
+ schema_name: Name of the schema.
+
+ Returns:
+ A JSON array of identifiers with namespace
+ [metalake, catalog, schema, semanticModel] and the metric name.
+ """
+ client = ctx.request_context.lifespan_context.rest_client()
+ return await client.as_semantic_model_operation().list_metrics(
+ catalog_name, schema_name
+ )
+
+ @mcp.tool(
+ tags={"semantic_model"},
+ annotations=ToolAnnotations(
+ readOnlyHint=True, destructiveHint=False, idempotentHint=True
+ ),
+ )
+ async def list_metric_infos(
+ ctx: Context, catalog_name: str, schema_name: str
+ ) -> str:
+ """List complete visible metrics across the Semantic Models in a
schema.
+
+ Uses the same visibility and ordering as list_metrics. A failed request
+ raises an error rather than returning a partial list.
+
+ Args:
+ ctx: The request context.
+ catalog_name: Name of the catalog.
+ schema_name: Name of the schema.
+
+ Returns:
+ A JSON array of objects with namespace
+ [metalake, catalog, schema, semanticModel] and a complete metric
+ containing name, expression, and any description, datatype,
+ aiContext, and customExtensions. JSON number precision is
preserved.
+ """
+ client = ctx.request_context.lifespan_context.rest_client()
+ return await client.as_semantic_model_operation().list_metric_infos(
+ catalog_name, schema_name
+ )
+
+ @mcp.tool(
+ tags={"semantic_model"},
+ annotations=ToolAnnotations(
+ readOnlyHint=True, destructiveHint=False, idempotentHint=True
+ ),
+ )
async def load_semantic_model(
ctx: Context,
catalog_name: str,
diff --git a/mcp-server/pyproject.toml b/mcp-server/pyproject.toml
index a127d73a62..1d6acfa504 100644
--- a/mcp-server/pyproject.toml
+++ b/mcp-server/pyproject.toml
@@ -31,6 +31,8 @@ dependencies = [
"pydantic>=2.12.0,<3",
# httpx.Auth plugin for hop-2 client_credentials fetch/cache.
"httpx-auth>=0.22,<0.24",
+ # Preserve exact JSON numbers in Semantic Model metric discovery responses.
+ "simplejson==3.20.1",
# TODO(#10754): pydocket (a transitive dep of fastmcp>=2.14.0)
# requires fakeredis>=2.32.1, but fakeredis 2.35.0 removed FakeConnection
from
# fakeredis.aioredis, which pydocket still uses. Pin fakeredis to <2.35.0
until the
diff --git
a/mcp-server/tests/integration/test_semantic_model_metric_discovery.py
b/mcp-server/tests/integration/test_semantic_model_metric_discovery.py
new file mode 100644
index 0000000000..09e5c4ab37
--- /dev/null
+++ b/mcp-server/tests/integration/test_semantic_model_metric_discovery.py
@@ -0,0 +1,343 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Discover metrics through the live MCP HTTP server and Gravitino REST API."""
+
+import asyncio
+from decimal import Decimal
+from uuid import uuid4
+
+import httpx
+import pytest
+import simplejson
+from fastmcp import Client
+from fastmcp.client.transports import StreamableHttpTransport
+from fastmcp.exceptions import ToolError
+
+from tests.integration.gravitino_setup import basic_auth_header
+
+# Pytest injects fixtures by argument name.
+# pylint: disable=redefined-outer-name
+
+
+class MetricDiscoveryFixture:
+ """Isolated Semantic Models and role grants for each live-server test."""
+
+ def __init__(self, env, rest_client):
+ self.env = env
+ self.rest_client = rest_client
+ self.metalake = "metric_mcp_" + uuid4().hex
+ self.base = f"/api/metalakes/{self.metalake}"
+ self.models_path = (
+ self.base
+ + "/catalogs/metrics_catalog/schemas/semantic/semantic-models"
+ )
+ self.revenue = self.metric("Revenue")
+ self.lower_revenue = self.metric("revenue")
+
+ def request(self, method, path, body=None):
+ response = self.rest_client.request(
+ method,
+ path,
+ content=(
+ None
+ if body is None
+ else simplejson.dumps(body, use_decimal=True)
+ ),
+ )
+ response.raise_for_status()
+ return simplejson.loads(response.content, use_decimal=True)
+
+ def provision(self):
+ self.request(
+ "POST",
+ self.base + "/catalogs",
+ {
+ "name": "metrics_catalog",
+ "type": "RELATIONAL",
+ "provider": "lakehouse-generic",
+ "comment": "",
+ "properties": {},
+ },
+ )
+ schemas_path = self.base + "/catalogs/metrics_catalog/schemas"
+ for schema in ("source", "semantic", "other", "empty"):
+ self.request(
+ "POST",
+ schemas_path,
+ {"name": schema, "comment": "", "properties": {}},
+ )
+ self.request(
+ "POST",
+ schemas_path + "/source/tables",
+ {
+ "name": "orders",
+ "columns": [{"name": "amount", "type": "long"}],
+ "properties": {
+ "format": "delta",
+ "external": "true",
+ "location": f"file:///tmp/{self.metalake}/orders",
+ },
+ },
+ )
+ for model, metrics in (
+ ("sales", [self.lower_revenue, self.revenue]),
+ ("hidden", [self.revenue]),
+ ("no_metrics", []),
+ ):
+ self.request(
+ "POST",
+ self.models_path,
+ {
+ "name": model,
+ "definition": self.definition(metrics),
+ "properties": {},
+ },
+ )
+ self.request(
+ "POST",
+ schemas_path + "/other/semantic-models",
+ {
+ "name": "sales",
+ "definition": self.definition([self.metric("other_schema")]),
+ },
+ )
+ self.request("POST", self.base + "/users", {"name": "metric_reader"})
+ self.request(
+ "POST",
+ self.base + "/roles",
+ {
+ "name": "metric_reader",
+ "properties": {},
+ "securableObjects": [
+ {
+ "fullName": "metrics_catalog",
+ "type": "CATALOG",
+ "privileges": [
+ {"name": "USE_CATALOG", "condition": "ALLOW"}
+ ],
+ },
+ {
+ "fullName": "metrics_catalog.semantic",
+ "type": "SCHEMA",
+ "privileges": [
+ {"name": "USE_SCHEMA", "condition": "ALLOW"}
+ ],
+ },
+ ],
+ },
+ )
+ self.request(
+ "PUT",
+ self.base + "/permissions/users/metric_reader/grant",
+ {"roleNames": ["metric_reader"]},
+ )
+
+ def call(self, tool, principal="admin", schema="semantic"):
+ async def invoke():
+ transport = StreamableHttpTransport(
+ url=self.env["mcp_url"],
+ headers={"Authorization": basic_auth_header(principal)},
+ )
+ async with Client(transport) as client:
+ result = await client.call_tool(
+ tool,
+ {
+ "metalake": self.metalake,
+ "catalog_name": "metrics_catalog",
+ "schema_name": schema,
+ },
+ )
+ return simplejson.loads(
+ result.content[0].text, use_decimal=True
+ )
+
+ return asyncio.run(invoke())
+
+ def assert_discovery(self, expected, principal="admin"):
+ assert self.call("list_metric_infos", principal) == expected
+ assert self.call("list_metrics", principal) == [
+ {"namespace": info["namespace"], "name": info["metric"]["name"]}
+ for info in expected
+ ]
+
+ def info(self, model, metric):
+ return {
+ "namespace": [self.metalake, "metrics_catalog", "semantic", model],
+ "metric": metric,
+ }
+
+ @staticmethod
+ def definition(metrics):
+ return {
+ "datasets": [
+ {
+ "name": "orders",
+ "source": {
+ "namespace": ["metrics_catalog", "source"],
+ "name": "orders",
+ },
+ }
+ ],
+ "metrics": metrics,
+ }
+
+ @staticmethod
+ def metric(name):
+ return {
+ "name": name,
+ "expression": {
+ "dialects": [
+ {"dialect": "ANSI_SQL", "expression": "SUM(orders.amount)"}
+ ]
+ },
+ "description": "Revenue - café 雪",
+ "datatype": "Decimal",
+ "aiContext": {
+ "instructions": "Use certified values",
+ "nested": {
+ "precise": Decimal("0.12345678901234567890123456789"),
+ "large": 1234567890123456789012345678901234567890,
+ "values": [True, None, "extra"],
+ },
+ },
+ "customExtensions": [
+ {"vendorName": "vendor", "data": '{"opaque": "雪"}'}
+ ],
+ }
+
+
[email protected]
+def metric_fixture(integration_env):
+ with httpx.Client(
+ base_url=integration_env["gravitino_uri"],
+ timeout=30.0,
+ headers={
+ "Authorization": basic_auth_header("admin"),
+ "Content-Type": "application/json",
+ },
+ ) as client:
+ fixture = MetricDiscoveryFixture(integration_env, client)
+ fixture.request(
+ "POST",
+ "/api/metalakes",
+ {"name": fixture.metalake, "properties": {}},
+ )
+ try:
+ fixture.provision()
+ yield fixture
+ finally:
+ fixture.request("DELETE", fixture.base + "?force=true")
+
+
+class TestSemanticModelMetricDiscovery:
+ """Verify both metric tools across real MCP and REST transports."""
+
+ def test_complete_metrics_order_and_schema_isolation(self, metric_fixture):
+ fixture = metric_fixture
+ fixture.assert_discovery(
+ [
+ fixture.info("hidden", fixture.revenue),
+ fixture.info("sales", fixture.revenue),
+ fixture.info("sales", fixture.lower_revenue),
+ ]
+ )
+ for tool in ("list_metrics", "list_metric_infos"):
+ assert fixture.call(tool, schema="empty") == []
+ actual = fixture.call("list_metric_infos", schema="other")
+ assert len(actual) == 1
+ assert actual[0]["namespace"] == [
+ fixture.metalake,
+ "metrics_catalog",
+ "other",
+ "sales",
+ ]
+ assert actual[0]["metric"]["name"] == "other_schema"
+
+ def test_model_visibility_grant_revoke_and_parent_access(
+ self, metric_fixture
+ ):
+ fixture = metric_fixture
+ fixture.assert_discovery([], "metric_reader")
+ expected = [
+ fixture.info("sales", fixture.revenue),
+ fixture.info("sales", fixture.lower_revenue),
+ ]
+ permission_path = (
+ fixture.base
+ +
"/permissions/roles/metric_reader/semantic_model/metrics_catalog.semantic.sales"
+ )
+ for privilege in ("USE_SEMANTIC_MODEL", "MODIFY_SEMANTIC_MODEL"):
+ body = {"privileges": [{"name": privilege, "condition": "ALLOW"}]}
+ fixture.request("PUT", permission_path + "/grant", body)
+ fixture.assert_discovery(expected, "metric_reader")
+ fixture.request("PUT", permission_path + "/revoke", body)
+ fixture.assert_discovery([], "metric_reader")
+ fixture.request(
+ "PUT",
+ fixture.base
+ + "/owners/semantic_model/metrics_catalog.semantic.sales",
+ {"name": "metric_reader", "type": "USER"},
+ )
+ fixture.assert_discovery(expected, "metric_reader")
+ for object_type, object_name, privilege in (
+ ("schema", "metrics_catalog.semantic", "USE_SCHEMA"),
+ ("catalog", "metrics_catalog", "USE_CATALOG"),
+ ):
+ path = (
+ fixture.base
+ +
f"/permissions/roles/metric_reader/{object_type}/{object_name}"
+ )
+ body = {"privileges": [{"name": privilege, "condition": "ALLOW"}]}
+ fixture.request("PUT", path + "/revoke", body)
+ for tool in ("list_metrics", "list_metric_infos"):
+ with pytest.raises(ToolError, match="ForbiddenException"):
+ fixture.call(tool, "metric_reader")
+ fixture.request("PUT", path + "/grant", body)
+ fixture.assert_discovery(expected, "metric_reader")
+
+ def test_definition_replacement_rename_and_drop(self, metric_fixture):
+ fixture = metric_fixture
+ fixture.request("DELETE", fixture.models_path + "/hidden")
+ changed = {
+ "name": "Revenue",
+ "expression": {
+ "dialects": [{"dialect": "ANSI_SQL", "expression": "COUNT(*)"}]
+ },
+ "aiContext": "Updated",
+ }
+ fixture.request(
+ "PUT",
+ fixture.models_path + "/sales",
+ {
+ "updates": [
+ {
+ "@type": "replaceDefinition",
+ "definition": fixture.definition([changed]),
+ },
+ {"@type": "rename", "newName": "renamed"},
+ ]
+ },
+ )
+ fixture.assert_discovery([fixture.info("renamed", changed)])
+ fixture.request("DELETE", fixture.models_path + "/renamed")
+ fixture.assert_discovery([])
+
+ def test_missing_schema_is_a_tool_error(self, metric_fixture):
+ for tool in ("list_metrics", "list_metric_infos"):
+ with pytest.raises(ToolError, match="NoSuchSchemaException"):
+ metric_fixture.call(tool, schema="missing")
diff --git a/mcp-server/tests/unit/client/test_utils.py
b/mcp-server/tests/unit/client/test_utils.py
new file mode 100644
index 0000000000..f8e570c8ae
--- /dev/null
+++ b/mcp-server/tests/unit/client/test_utils.py
@@ -0,0 +1,63 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Regression tests for precision in shared REST response extraction."""
+
+import json
+import unittest
+from decimal import Decimal
+
+import httpx
+
+from mcp_server.client.plain.utils import (
+ extract_content_from_response,
+ extract_response,
+)
+
+
+class TestResponseExtraction(unittest.TestCase):
+ def test_extractors_preserve_nested_numbers(self):
+ response = httpx.Response(
+ 200,
+ content=(
+ b'{"code":0,"data":{"nested":['
+ b"0.12345678901234567890123456789,"
+ b"1234567890123456789012345678901234567890,"
+ b'1.00,true,null,"extra"]}}'
+ ),
+ )
+ expected = {
+ "nested": [
+ Decimal("0.12345678901234567890123456789"),
+ 1234567890123456789012345678901234567890,
+ Decimal("1.00"),
+ True,
+ None,
+ "extra",
+ ]
+ }
+ self.assertEqual(
+ expected,
+ json.loads(
+ extract_content_from_response(response, "data"),
+ parse_float=Decimal,
+ ),
+ )
+ self.assertEqual(
+ {"code": 0, "data": expected},
+ json.loads(extract_response(response), parse_float=Decimal),
+ )
diff --git a/mcp-server/tests/unit/tools/mock_operation.py
b/mcp-server/tests/unit/tools/mock_operation.py
index 48737da652..481bdd650b 100644
--- a/mcp-server/tests/unit/tools/mock_operation.py
+++ b/mcp-server/tests/unit/tools/mock_operation.py
@@ -492,6 +492,14 @@ class MockViewOperation(ViewOperation):
class MockSemanticModelOperation(SemanticModelOperation):
+ async def list_metrics(self, catalog_name: str, schema_name: str) -> str:
+ return "[]"
+
+ async def list_metric_infos(
+ self, catalog_name: str, schema_name: str
+ ) -> str:
+ return "[]"
+
async def list_of_semantic_models(
self, catalog_name: str, schema_name: str
) -> str:
diff --git a/mcp-server/tests/unit/tools/test_semantic_model.py
b/mcp-server/tests/unit/tools/test_semantic_model.py
index 0f121fcab9..c54d5537f2 100644
--- a/mcp-server/tests/unit/tools/test_semantic_model.py
+++ b/mcp-server/tests/unit/tools/test_semantic_model.py
@@ -19,9 +19,11 @@
import json
import unittest
+from decimal import Decimal
from unittest.mock import patch
import httpx
+import simplejson
from fastmcp import Client
from fastmcp.exceptions import ToolError
@@ -38,6 +40,11 @@ _MODEL_ARGS = {**_NAMESPACE, "semantic_model_name":
"sales_model"}
_MODELS_PATH = (
"/api/metalakes/test_metalake/catalogs/sales/schemas/mart/semantic-models"
)
+_METRICS_PATH =
"/api/metalakes/test_metalake/catalogs/sales/schemas/mart/semantic-model-metrics"
+_METRIC_TOOLS = (
+ ("list_metrics", "identifiers", "false"),
+ ("list_metric_infos", "metrics", "true"),
+)
class TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
@@ -85,7 +92,15 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
def _respond(self, request):
self.requests.append(request)
- return httpx.Response(self.status, json=self.response)
+ return httpx.Response(
+ self.status,
+ content=(
+ self.response
+ if isinstance(self.response, bytes)
+ else simplejson.dumps(self.response, use_decimal=True)
+ ),
+ headers={"Content-Type": "application/json"},
+ )
def _create_client(self, *args, **kwargs):
# Keep the production factory/client wiring and inject only transport.
@@ -109,7 +124,7 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
async def _call(self, name, arguments):
async with Client(self.mcp) as client:
result = await client.call_tool(name, arguments)
- return json.loads(result.content[0].text)
+ return json.loads(result.content[0].text, parse_float=Decimal)
def _assert_request(self, method, path, body=None):
request = self.requests[-1]
@@ -139,6 +154,190 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
self.assertEqual(result, identifiers)
self._assert_request("GET", _MODELS_PATH)
+ async def test_list_metrics_preserves_full_identifiers_and_order(self):
+ namespace = ["test_metalake", "sales", "mart", "a.model"]
+ identifiers = [
+ {"namespace": namespace, "name": name}
+ for name in ("Revenue", "revenue", "收入 /é+%")
+ ] + [{"namespace": namespace[:-1] + ["b"], "name": "Revenue"}]
+ self.response = {"code": 0, "identifiers": identifiers}
+ self.assertEqual(
+ identifiers, await self._call("list_metrics", _NAMESPACE)
+ )
+ self.assertEqual(1, len(self.requests))
+ self._assert_request("GET", _METRICS_PATH + "?details=false")
+
+ async def test_metric_infos_preserve_complete_metrics_and_numbers(self):
+ metric = {
+ "name": "Revenue",
+ "expression": {
+ "dialects": [
+ {"dialect": "ANSI_SQL", "expression":
"SUM(orders.amount)"},
+ {
+ "dialect": "SPARK_SQL",
+ "expression": "sum(orders.amount)",
+ },
+ ]
+ },
+ "description": "Revenue - café 雪",
+ "datatype": "Decimal",
+ "aiContext": {
+ "instructions": "Use certified values",
+ "synonyms": ["Sales"],
+ "examples": ["Revenue by year"],
+ "nested": {
+ "precise": Decimal("0.12345678901234567890123456789"),
+ "large": 1234567890123456789012345678901234567890,
+ "values": [True, None, "extra", Decimal("1.00")],
+ },
+ },
+ "customExtensions": [
+ {"vendorName": "vendor", "data": '{"opaque": "雪"}'}
+ ],
+ }
+ namespace = ["test_metalake", "sales", "mart", "a"]
+ infos = [
+ {"namespace": namespace, "metric": metric},
+ {
+ "namespace": namespace,
+ "metric": {
+ **metric,
+ "name": "revenue",
+ "aiContext": "Certified",
+ },
+ },
+ {
+ "namespace": namespace[:-1] + ["b"],
+ "metric": {
+ "name": "Revenue",
+ "expression": metric["expression"],
+ },
+ },
+ ]
+ self.response = {"code": 0, "metrics": infos}
+ result = await self._call("list_metric_infos", _NAMESPACE)
+ self.assertEqual(infos, result)
+ self.assertIsInstance(
+ result[0]["metric"]["aiContext"]["nested"]["precise"], Decimal
+ )
+ self.assertEqual(1, len(self.requests))
+ self._assert_request("GET", _METRICS_PATH + "?details=true")
+
+ self.definition["metrics"] = [metric]
+ self.response = {"code": 0, "semanticModel": self.model}
+ model = await self._call("load_semantic_model", _MODEL_ARGS)
+ self.assertEqual(model, self.model)
+ self.assertEqual(result[0]["metric"],
model["definition"]["metrics"][0])
+ self._assert_request("GET", f"{_MODELS_PATH}/sales_model")
+
+ async def test_metric_discovery_empty_results(self):
+ for tool, field, details in _METRIC_TOOLS:
+ with self.subTest(tool=tool):
+ self.requests.clear()
+ self.response = {"code": 0, field: []}
+ self.assertEqual([], await self._call(tool, _NAMESPACE))
+ self.assertEqual(1, len(self.requests))
+ self._assert_request(
+ "GET", _METRICS_PATH + "?details=" + details
+ )
+
+ async def test_metric_discovery_path_encoding_and_request_scope(self):
+ self.response = {"code": 0, "identifiers": [], "metrics": []}
+ arguments = {
+ "metalake": "ml/雪",
+ "catalog_name": "cat?",
+ "schema_name": "sch #+%",
+ }
+ path =
"/api/metalakes/ml%2F%E9%9B%AA/catalogs/cat%3F/schemas/sch%20%23%2B%25/semantic-model-metrics"
+ for tool, _, details in _METRIC_TOOLS:
+ with self.subTest(tool=tool):
+ with patch(
+ "mcp_server.core.context._get_request_authorization",
+ return_value="Bearer request-test-token",
+ ):
+ await self._call(tool, arguments)
+ request = self.requests[-1]
+ self.assertEqual(
+ path + "?details=" + details, request.url.raw_path.decode()
+ )
+ self.assertEqual(
+ "Bearer request-test-token",
+ request.headers["Authorization"],
+ )
+ await self._call(tool, _NAMESPACE)
+ self._assert_request(
+ "GET", _METRICS_PATH + "?details=" + details
+ )
+
+ async def test_metric_discovery_rejects_ambiguous_path_names(self):
+ for tool, _, _ in _METRIC_TOOLS:
+ for argument in ("metalake", "catalog_name", "schema_name"):
+ invalid_names = (
+ (".", "..") if argument == "metalake" else ("", ".", "..")
+ )
+ for name in invalid_names:
+ with self.subTest(tool=tool, argument=argument, name=name):
+ with self.assertRaisesRegex(
+ ToolError, "REST path names"
+ ):
+ await self._call(
+ tool, {**_NAMESPACE, argument: name}
+ )
+ self.assertEqual([], self.requests)
+
+ async def test_metric_discovery_propagates_rest_failures(self):
+ for tool, field, _ in _METRIC_TOOLS:
+ for status, code, error_type in (
+ (401, 1011, "UnauthorizedException"),
+ (403, 1008, "ForbiddenException"),
+ (404, 1003, "NoSuchSchemaException"),
+ (500, 1002, "RuntimeException"),
+ (501, 1006, "UnsupportedOperationException"),
+ ):
+ with self.subTest(tool=tool, status=status):
+ self.status = status
+ self.response = {
+ "code": code,
+ "type": error_type,
+ "message": "Discovery rejected",
+ field: [],
+ }
+ with self.assertRaisesRegex(ToolError, error_type):
+ await self._call(tool, _NAMESPACE)
+
+ async def test_metric_discovery_rejects_invalid_responses(self):
+ for tool, field, _ in _METRIC_TOOLS:
+ for body in (
+ [],
+ {},
+ {field: []},
+ {"code": 0},
+ {"code": 0, field: None},
+ {"code": 0, field: {}},
+ {"code": 0, field: "[]"},
+ ):
+ with self.subTest(tool=tool, body=body):
+ self.response = body
+ with self.assertRaisesRegex(
+ ToolError, "Invalid Gravitino response"
+ ):
+ await self._call(tool, _NAMESPACE)
+ self.status = 502
+ self.response = {"code": 0, field: []}
+ with self.assertRaisesRegex(ToolError, "502"):
+ await self._call(tool, _NAMESPACE)
+ for body in (b"Bad Gateway", b'\xff\xfe{"code":0}'):
+ with self.subTest(tool=tool, body=body):
+ self.response = body
+ self.status = 502
+ with self.assertRaisesRegex(ToolError, "502"):
+ await self._call(tool, _NAMESPACE)
+ self.status = 200
+ with self.assertRaisesRegex(
+ ToolError, "Invalid Gravitino response: invalid JSON"
+ ):
+ await self._call(tool, _NAMESPACE)
+
async def test_load_semantic_model_preserves_native_definition(self):
result = await self._call("load_semantic_model", _MODEL_ARGS)
self.assertEqual(result, self.model)
@@ -354,7 +553,7 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
)
self.assertEqual(self.requests, [])
- async def test_semantic_model_tag_exposes_all_five_tools(self):
+ async def test_semantic_model_tag_exposes_all_tools(self):
self.mcp = GravitinoMCPServer(
Setting("test_metalake", tags={"semantic_model"})
).mcp
@@ -364,6 +563,8 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
set(tools),
{
"list_of_semantic_models",
+ "list_metrics",
+ "list_metric_infos",
"load_semantic_model",
"create_semantic_model",
"alter_semantic_model",
@@ -372,6 +573,22 @@ class
TestSemanticModelTool(unittest.IsolatedAsyncioTestCase):
)
for tool in tools.values():
self.assertIn("metalake", tool.inputSchema["properties"])
+ for name, _, _ in _METRIC_TOOLS:
+ tool = tools[name]
+ self.assertEqual(
+ {"catalog_name", "schema_name"},
+ set(tool.inputSchema["required"]),
+ )
+ for name in (
+ "list_of_semantic_models",
+ "list_metrics",
+ "list_metric_infos",
+ "load_semantic_model",
+ ):
+ tool = tools[name]
+ self.assertTrue(tool.annotations.readOnlyHint)
+ self.assertTrue(tool.annotations.idempotentHint)
+ self.assertFalse(tool.annotations.destructiveHint)
self.assertEqual(
set(tools["create_semantic_model"].inputSchema["required"]),
{"catalog_name", "schema_name", "name", "definition"},
@@ -391,6 +608,8 @@ class
TestSemanticModelToolWithMockOperation(unittest.IsolatedAsyncioTestCase):
model = {"name": "mock_semantic_model"}
cases = (
("list_of_semantic_models", _NAMESPACE, []),
+ ("list_metrics", _NAMESPACE, []),
+ ("list_metric_infos", _NAMESPACE, []),
("load_semantic_model", model_args, model),
(
"create_semantic_model",
diff --git a/mcp-server/uv.lock b/mcp-server/uv.lock
index 75cb800510..c17bcf67da 100644
--- a/mcp-server/uv.lock
+++ b/mcp-server/uv.lock
@@ -497,6 +497,7 @@ dependencies = [
{ name = "fastmcp" },
{ name = "httpx-auth" },
{ name = "pydantic" },
+ { name = "simplejson" },
]
[package.dev-dependencies]
@@ -512,6 +513,7 @@ requires-dist = [
{ name = "fastmcp", specifier = "==3.4.5" },
{ name = "httpx-auth", specifier = ">=0.22,<0.24" },
{ name = "pydantic", specifier = ">=2.12.0,<3" },
+ { name = "simplejson", specifier = "==3.20.1" },
]
[package.metadata.requires-dev]
@@ -1444,6 +1446,67 @@ wheels = [
{ url =
"https://files.pythonhosted.org/packages/b7/46/f5af3402b579fd5e11573ce652019a67074317e18c1935cc0b4ba9b35552/secretstorage-3.5.0-py3-none-any.whl",
hash =
"sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137", size
= 15554, upload-time = "2025-11-23T19:02:51.545Z" },
]
+[[package]]
+name = "simplejson"
+version = "3.20.1"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url =
"https://files.pythonhosted.org/packages/af/92/51b417685abd96b31308b61b9acce7ec50d8e1de8fbc39a7fd4962c60689/simplejson-3.20.1.tar.gz",
hash =
"sha256:e64139b4ec4f1f24c142ff7dcafe55a22b811a74d86d66560c8815687143037d", size
= 85591, upload-time = "2025-02-15T05:18:53.15Z" }
+wheels = [
+ { url =
"https://files.pythonhosted.org/packages/25/c4/627214fb418cd4a17fb0230ff0b6c3bb4a85cbb48dd69c85dcc3b85df828/simplejson-3.20.1-cp310-cp310-macosx_10_9_universal2.whl",
hash =
"sha256:e580aa65d5f6c3bf41b9b4afe74be5d5ddba9576701c107c772d936ea2b5043a", size
= 93790, upload-time = "2025-02-15T05:15:32.954Z" },
+ { url =
"https://files.pythonhosted.org/packages/15/ca/56a6a2a33cbcf330c4d71af3f827c47e4e0ba791e78f2642f3d1ab02ff31/simplejson-3.20.1-cp310-cp310-macosx_10_9_x86_64.whl",
hash =
"sha256:4a586ce4f78cec11f22fe55c5bee0f067e803aab9bad3441afe2181693b5ebb5", size
= 75707, upload-time = "2025-02-15T05:15:34.954Z" },
+ { url =
"https://files.pythonhosted.org/packages/a9/c8/3d92b67e03a3b6207d97202669f9454ed700b35ade9bd4428265a078fb6c/simplejson-3.20.1-cp310-cp310-macosx_11_0_arm64.whl",
hash =
"sha256:74a1608f9e6e8c27a4008d70a54270868306d80ed48c9df7872f9f4b8ac87808", size
= 75700, upload-time = "2025-02-15T05:15:37.144Z" },
+ { url =
"https://files.pythonhosted.org/packages/74/30/20001219d6fdca4aaa3974c96dfb6955a766b4e2cc950505a5b51fd050b0/simplejson-3.20.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:03db8cb64154189a92a7786209f24e391644f3a3fa335658be2df2af1960b8d8", size
= 138672, upload-time = "2025-02-15T05:15:38.547Z" },
+ { url =
"https://files.pythonhosted.org/packages/21/47/50157810876c2a7ebbd6e6346ec25eda841fe061fecaa02538a7742a3d2a/simplejson-3.20.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
hash =
"sha256:eea7e2b7d858f6fdfbf0fe3cb846d6bd8a45446865bc09960e51f3d473c2271b", size
= 146616, upload-time = "2025-02-15T05:15:39.871Z" },
+ { url =
"https://files.pythonhosted.org/packages/95/60/8c97cdc93096437b0aca2745aca63c880fe2315fd7f6a6ce6edbb344a2ae/simplejson-3.20.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
hash =
"sha256:e66712b17d8425bb7ff8968d4c7c7fd5a2dd7bd63728b28356223c000dd2f91f", size
= 134344, upload-time = "2025-02-15T05:15:42.091Z" },
+ { url =
"https://files.pythonhosted.org/packages/bb/9e/da184f0e9bb3a5d7ffcde713bd41b4fe46cca56b6f24d9bd155fac56805a/simplejson-3.20.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:a2cc4f6486f9f515b62f5831ff1888886619b84fc837de68f26d919ba7bbdcbc", size
= 138017, upload-time = "2025-02-15T05:15:43.542Z" },
+ { url =
"https://files.pythonhosted.org/packages/31/db/00d1a8d9b036db98f678c8a3c69ed17d2894d1768d7a00576e787ad3e546/simplejson-3.20.1-cp310-cp310-musllinux_1_2_aarch64.whl",
hash =
"sha256:a3c2df555ee4016148fa192e2b9cd9e60bc1d40769366134882685e90aee2a1e", size
= 140118, upload-time = "2025-02-15T05:15:45.7Z" },
+ { url =
"https://files.pythonhosted.org/packages/52/21/57fc47eab8c1c73390b933a5ba9271f08e3e1ec83162c580357f28f5b97c/simplejson-3.20.1-cp310-cp310-musllinux_1_2_i686.whl",
hash =
"sha256:78520f04b7548a5e476b5396c0847e066f1e0a4c0c5e920da1ad65e95f410b11", size
= 140314, upload-time = "2025-02-15T05:16:07.949Z" },
+ { url =
"https://files.pythonhosted.org/packages/ad/cc/7cfd78d1e0fa5e57350b98cfe77353b6dfa13dce21afa4060e1019223852/simplejson-3.20.1-cp310-cp310-musllinux_1_2_ppc64le.whl",
hash =
"sha256:f4bd49ecde87b0fe9f55cc971449a32832bca9910821f7072bbfae1155eaa007", size
= 148544, upload-time = "2025-02-15T05:16:09.455Z" },
+ { url =
"https://files.pythonhosted.org/packages/63/26/1c894a1c2bd95dc8be0cf5a2fa73b0d173105b6ca18c90cb981ff10443d0/simplejson-3.20.1-cp310-cp310-musllinux_1_2_x86_64.whl",
hash =
"sha256:7eaae2b88eb5da53caaffdfa50e2e12022553949b88c0df4f9a9663609373f72", size
= 141172, upload-time = "2025-02-15T05:16:10.966Z" },
+ { url =
"https://files.pythonhosted.org/packages/93/27/0717dccc10cd9988dbf1314def52ab32678a95a95328bb37cafacf499400/simplejson-3.20.1-cp310-cp310-win32.whl",
hash =
"sha256:e836fb88902799eac8debc2b642300748f4860a197fa3d9ea502112b6bb8e142", size
= 74181, upload-time = "2025-02-15T05:16:12.361Z" },
+ { url =
"https://files.pythonhosted.org/packages/5f/af/593f896573f306519332d4287b1ab8b7b888c239bbd5159f7054d7055c2d/simplejson-3.20.1-cp310-cp310-win_amd64.whl",
hash =
"sha256:b122a19b552b212fc3b5b96fc5ce92333d4a9ac0a800803e1f17ebb16dac4be5", size
= 75738, upload-time = "2025-02-15T05:16:14.438Z" },
+ { url =
"https://files.pythonhosted.org/packages/76/59/74bc90d1c051bc2432c96b34bd4e8036875ab58b4fcbe4d6a5a76985f853/simplejson-3.20.1-cp311-cp311-macosx_10_9_universal2.whl",
hash =
"sha256:325b8c107253d3217e89d7b50c71015b5b31e2433e6c5bf38967b2f80630a8ca", size
= 92132, upload-time = "2025-02-15T05:16:15.743Z" },
+ { url =
"https://files.pythonhosted.org/packages/71/c7/1970916e0c51794fff89f76da2f632aaf0b259b87753c88a8c409623d3e1/simplejson-3.20.1-cp311-cp311-macosx_10_9_x86_64.whl",
hash =
"sha256:88a7baa8211089b9e58d78fbc1b0b322103f3f3d459ff16f03a36cece0d0fcf0", size
= 74956, upload-time = "2025-02-15T05:16:17.062Z" },
+ { url =
"https://files.pythonhosted.org/packages/c8/0d/98cc5909180463f1d75fac7180de62d4cdb4e82c4fef276b9e591979372c/simplejson-3.20.1-cp311-cp311-macosx_11_0_arm64.whl",
hash =
"sha256:299b1007b8101d50d95bc0db1bf5c38dc372e85b504cf77f596462083ee77e3f", size
= 74772, upload-time = "2025-02-15T05:16:19.204Z" },
+ { url =
"https://files.pythonhosted.org/packages/e1/94/a30a5211a90d67725a3e8fcc1c788189f2ae2ed2b96b63ed15d0b7f5d6bb/simplejson-3.20.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:03ec618ed65caab48e81e3ed29586236a8e57daef792f1f3bb59504a7e98cd10", size
= 143575, upload-time = "2025-02-15T05:16:21.337Z" },
+ { url =
"https://files.pythonhosted.org/packages/ee/08/cdb6821f1058eb5db46d252de69ff7e6c53f05f1bae6368fe20d5b51d37e/simplejson-3.20.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
hash =
"sha256:cd2cdead1d3197f0ff43373cf4730213420523ba48697743e135e26f3d179f38", size
= 153241, upload-time = "2025-02-15T05:16:22.859Z" },
+ { url =
"https://files.pythonhosted.org/packages/4c/2d/ca3caeea0bdc5efc5503d5f57a2dfb56804898fb196dfada121323ee0ccb/simplejson-3.20.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
hash =
"sha256:3466d2839fdc83e1af42e07b90bc8ff361c4e8796cd66722a40ba14e458faddd", size
= 141500, upload-time = "2025-02-15T05:16:25.068Z" },
+ { url =
"https://files.pythonhosted.org/packages/e1/33/d3e0779d5c58245e7370c98eb969275af6b7a4a5aec3b97cbf85f09ad328/simplejson-3.20.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:d492ed8e92f3a9f9be829205f44b1d0a89af6582f0cf43e0d129fa477b93fe0c", size
= 144757, upload-time = "2025-02-15T05:16:28.301Z" },
+ { url =
"https://files.pythonhosted.org/packages/54/53/2d93128bb55861b2fa36c5944f38da51a0bc6d83e513afc6f7838440dd15/simplejson-3.20.1-cp311-cp311-musllinux_1_2_aarch64.whl",
hash =
"sha256:f924b485537b640dc69434565463fd6fc0c68c65a8c6e01a823dd26c9983cf79", size
= 144409, upload-time = "2025-02-15T05:16:29.687Z" },
+ { url =
"https://files.pythonhosted.org/packages/99/4c/dac310a98f897ad3435b4bdc836d92e78f09e38c5dbf28211ed21dc59fa2/simplejson-3.20.1-cp311-cp311-musllinux_1_2_i686.whl",
hash =
"sha256:9e8eacf6a3491bf76ea91a8d46726368a6be0eb94993f60b8583550baae9439e", size
= 146082, upload-time = "2025-02-15T05:16:31.064Z" },
+ { url =
"https://files.pythonhosted.org/packages/ee/22/d7ba958cfed39827335b82656b1c46f89678faecda9a7677b47e87b48ee6/simplejson-3.20.1-cp311-cp311-musllinux_1_2_ppc64le.whl",
hash =
"sha256:d34d04bf90b4cea7c22d8b19091633908f14a096caa301b24c2f3d85b5068fb8", size
= 154339, upload-time = "2025-02-15T05:16:32.719Z" },
+ { url =
"https://files.pythonhosted.org/packages/b8/c8/b072b741129406a7086a0799c6f5d13096231bf35fdd87a0cffa789687fc/simplejson-3.20.1-cp311-cp311-musllinux_1_2_x86_64.whl",
hash =
"sha256:69dd28d4ce38390ea4aaf212902712c0fd1093dc4c1ff67e09687c3c3e15a749", size
= 147915, upload-time = "2025-02-15T05:16:34.291Z" },
+ { url =
"https://files.pythonhosted.org/packages/6c/46/8347e61e9cf3db5342a42f7fd30a81b4f5cf85977f916852d7674a540907/simplejson-3.20.1-cp311-cp311-win32.whl",
hash =
"sha256:dfe7a9da5fd2a3499436cd350f31539e0a6ded5da6b5b3d422df016444d65e43", size
= 73972, upload-time = "2025-02-15T05:16:35.712Z" },
+ { url =
"https://files.pythonhosted.org/packages/01/85/b52f24859237b4e9d523d5655796d911ba3d46e242eb1959c45b6af5aedd/simplejson-3.20.1-cp311-cp311-win_amd64.whl",
hash =
"sha256:896a6c04d7861d507d800da7642479c3547060bf97419d9ef73d98ced8258766", size
= 75595, upload-time = "2025-02-15T05:16:36.957Z" },
+ { url =
"https://files.pythonhosted.org/packages/8d/eb/34c16a1ac9ba265d024dc977ad84e1659d931c0a700967c3e59a98ed7514/simplejson-3.20.1-cp312-cp312-macosx_10_9_universal2.whl",
hash =
"sha256:f31c4a3a7ab18467ee73a27f3e59158255d1520f3aad74315edde7a940f1be23", size
= 93100, upload-time = "2025-02-15T05:16:38.801Z" },
+ { url =
"https://files.pythonhosted.org/packages/41/fc/2c2c007d135894971e6814e7c0806936e5bade28f8db4dd7e2a58b50debd/simplejson-3.20.1-cp312-cp312-macosx_10_9_x86_64.whl",
hash =
"sha256:884e6183d16b725e113b83a6fc0230152ab6627d4d36cb05c89c2c5bccfa7bc6", size
= 75464, upload-time = "2025-02-15T05:16:40.905Z" },
+ { url =
"https://files.pythonhosted.org/packages/0f/05/2b5ecb33b776c34bb5cace5de5d7669f9b60e3ca13c113037b2ca86edfbd/simplejson-3.20.1-cp312-cp312-macosx_11_0_arm64.whl",
hash =
"sha256:03d7a426e416fe0d3337115f04164cd9427eb4256e843a6b8751cacf70abc832", size
= 75112, upload-time = "2025-02-15T05:16:42.246Z" },
+ { url =
"https://files.pythonhosted.org/packages/fe/36/1f3609a2792f06cd4b71030485f78e91eb09cfd57bebf3116bf2980a8bac/simplejson-3.20.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:000602141d0bddfcff60ea6a6e97d5e10c9db6b17fd2d6c66199fa481b6214bb", size
= 150182, upload-time = "2025-02-15T05:16:43.557Z" },
+ { url =
"https://files.pythonhosted.org/packages/2f/b0/053fbda38b8b602a77a4f7829def1b4f316cd8deb5440a6d3ee90790d2a4/simplejson-3.20.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
hash =
"sha256:af8377a8af78226e82e3a4349efdde59ffa421ae88be67e18cef915e4023a595", size
= 158363, upload-time = "2025-02-15T05:16:45.748Z" },
+ { url =
"https://files.pythonhosted.org/packages/d1/4b/2eb84ae867539a80822e92f9be4a7200dffba609275faf99b24141839110/simplejson-3.20.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
hash =
"sha256:15c7de4c88ab2fbcb8781a3b982ef883696736134e20b1210bca43fb42ff1acf", size
= 148415, upload-time = "2025-02-15T05:16:47.861Z" },
+ { url =
"https://files.pythonhosted.org/packages/e0/bd/400b0bd372a5666addf2540c7358bfc3841b9ce5cdbc5cc4ad2f61627ad8/simplejson-3.20.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:455a882ff3f97d810709f7b620007d4e0aca8da71d06fc5c18ba11daf1c4df49", size
= 152213, upload-time = "2025-02-15T05:16:49.25Z" },
+ { url =
"https://files.pythonhosted.org/packages/50/12/143f447bf6a827ee9472693768dc1a5eb96154f8feb140a88ce6973a3cfa/simplejson-3.20.1-cp312-cp312-musllinux_1_2_aarch64.whl",
hash =
"sha256:fc0f523ce923e7f38eb67804bc80e0a028c76d7868500aa3f59225574b5d0453", size
= 150048, upload-time = "2025-02-15T05:16:51.5Z" },
+ { url =
"https://files.pythonhosted.org/packages/5e/ea/dd9b3e8e8ed710a66f24a22c16a907c9b539b6f5f45fd8586bd5c231444e/simplejson-3.20.1-cp312-cp312-musllinux_1_2_i686.whl",
hash =
"sha256:76461ec929282dde4a08061071a47281ad939d0202dc4e63cdd135844e162fbc", size
= 151668, upload-time = "2025-02-15T05:16:53Z" },
+ { url =
"https://files.pythonhosted.org/packages/99/af/ee52a8045426a0c5b89d755a5a70cc821815ef3c333b56fbcad33c4435c0/simplejson-3.20.1-cp312-cp312-musllinux_1_2_ppc64le.whl",
hash =
"sha256:ab19c2da8c043607bde4d4ef3a6b633e668a7d2e3d56f40a476a74c5ea71949f", size
= 158840, upload-time = "2025-02-15T05:16:54.851Z" },
+ { url =
"https://files.pythonhosted.org/packages/68/db/ab32869acea6b5de7d75fa0dac07a112ded795d41eaa7e66c7813b17be95/simplejson-3.20.1-cp312-cp312-musllinux_1_2_x86_64.whl",
hash =
"sha256:b2578bedaedf6294415197b267d4ef678fea336dd78ee2a6d2f4b028e9d07be3", size
= 154212, upload-time = "2025-02-15T05:16:56.318Z" },
+ { url =
"https://files.pythonhosted.org/packages/fa/7a/e3132d454977d75a3bf9a6d541d730f76462ebf42a96fea2621498166f41/simplejson-3.20.1-cp312-cp312-win32.whl",
hash =
"sha256:339f407373325a36b7fd744b688ba5bae0666b5d340ec6d98aebc3014bf3d8ea", size
= 74101, upload-time = "2025-02-15T05:16:57.746Z" },
+ { url =
"https://files.pythonhosted.org/packages/bc/5d/4e243e937fa3560107c69f6f7c2eed8589163f5ed14324e864871daa2dd9/simplejson-3.20.1-cp312-cp312-win_amd64.whl",
hash =
"sha256:627d4486a1ea7edf1f66bb044ace1ce6b4c1698acd1b05353c97ba4864ea2e17", size
= 75736, upload-time = "2025-02-15T05:16:59.017Z" },
+ { url =
"https://files.pythonhosted.org/packages/c4/03/0f453a27877cb5a5fff16a975925f4119102cc8552f52536b9a98ef0431e/simplejson-3.20.1-cp313-cp313-macosx_10_13_universal2.whl",
hash =
"sha256:71e849e7ceb2178344998cbe5ade101f1b329460243c79c27fbfc51c0447a7c3", size
= 93109, upload-time = "2025-02-15T05:17:00.377Z" },
+ { url =
"https://files.pythonhosted.org/packages/74/1f/a729f4026850cabeaff23e134646c3f455e86925d2533463420635ae54de/simplejson-3.20.1-cp313-cp313-macosx_10_13_x86_64.whl",
hash =
"sha256:b63fdbab29dc3868d6f009a59797cefaba315fd43cd32ddd998ee1da28e50e29", size
= 75475, upload-time = "2025-02-15T05:17:02.544Z" },
+ { url =
"https://files.pythonhosted.org/packages/e2/14/50a2713fee8ff1f8d655b1a14f4a0f1c0c7246768a1b3b3d12964a4ed5aa/simplejson-3.20.1-cp313-cp313-macosx_11_0_arm64.whl",
hash =
"sha256:1190f9a3ce644fd50ec277ac4a98c0517f532cfebdcc4bd975c0979a9f05e1fb", size
= 75112, upload-time = "2025-02-15T05:17:03.875Z" },
+ { url =
"https://files.pythonhosted.org/packages/45/86/ea9835abb646755140e2d482edc9bc1e91997ed19a59fd77ae4c6a0facea/simplejson-3.20.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
hash =
"sha256:c1336ba7bcb722ad487cd265701ff0583c0bb6de638364ca947bb84ecc0015d1", size
= 150245, upload-time = "2025-02-15T05:17:06.899Z" },
+ { url =
"https://files.pythonhosted.org/packages/12/b4/53084809faede45da829fe571c65fbda8479d2a5b9c633f46b74124d56f5/simplejson-3.20.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl",
hash =
"sha256:e975aac6a5acd8b510eba58d5591e10a03e3d16c1cf8a8624ca177491f7230f0", size
= 158465, upload-time = "2025-02-15T05:17:08.707Z" },
+ { url =
"https://files.pythonhosted.org/packages/a9/7d/d56579468d1660b3841e1f21c14490d103e33cf911886b22652d6e9683ec/simplejson-3.20.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl",
hash =
"sha256:6a6dd11ee282937ad749da6f3b8d87952ad585b26e5edfa10da3ae2536c73078", size
= 148514, upload-time = "2025-02-15T05:17:11.323Z" },
+ { url =
"https://files.pythonhosted.org/packages/19/e3/874b1cca3d3897b486d3afdccc475eb3a09815bf1015b01cf7fcb52a55f0/simplejson-3.20.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
hash =
"sha256:ab980fcc446ab87ea0879edad41a5c28f2d86020014eb035cf5161e8de4474c6", size
= 152262, upload-time = "2025-02-15T05:17:13.543Z" },
+ { url =
"https://files.pythonhosted.org/packages/32/84/f0fdb3625292d945c2bd13a814584603aebdb38cfbe5fe9be6b46fe598c4/simplejson-3.20.1-cp313-cp313-musllinux_1_2_aarch64.whl",
hash =
"sha256:f5aee2a4cb6b146bd17333ac623610f069f34e8f31d2f4f0c1a2186e50c594f0", size
= 150164, upload-time = "2025-02-15T05:17:15.021Z" },
+ { url =
"https://files.pythonhosted.org/packages/95/51/6d625247224f01eaaeabace9aec75ac5603a42f8ebcce02c486fbda8b428/simplejson-3.20.1-cp313-cp313-musllinux_1_2_i686.whl",
hash =
"sha256:652d8eecbb9a3b6461b21ec7cf11fd0acbab144e45e600c817ecf18e4580b99e", size
= 151795, upload-time = "2025-02-15T05:17:16.542Z" },
+ { url =
"https://files.pythonhosted.org/packages/7f/d9/bb921df6b35be8412f519e58e86d1060fddf3ad401b783e4862e0a74c4c1/simplejson-3.20.1-cp313-cp313-musllinux_1_2_ppc64le.whl",
hash =
"sha256:8c09948f1a486a89251ee3a67c9f8c969b379f6ffff1a6064b41fea3bce0a112", size
= 159027, upload-time = "2025-02-15T05:17:18.083Z" },
+ { url =
"https://files.pythonhosted.org/packages/03/c5/5950605e4ad023a6621cf4c931b29fd3d2a9c1f36be937230bfc83d7271d/simplejson-3.20.1-cp313-cp313-musllinux_1_2_x86_64.whl",
hash =
"sha256:cbbd7b215ad4fc6f058b5dd4c26ee5c59f72e031dfda3ac183d7968a99e4ca3a", size
= 154380, upload-time = "2025-02-15T05:17:20.334Z" },
+ { url =
"https://files.pythonhosted.org/packages/66/ad/b74149557c5ec1e4e4d55758bda426f5d2ec0123cd01a53ae63b8de51fa3/simplejson-3.20.1-cp313-cp313-win32.whl",
hash =
"sha256:ae81e482476eaa088ef9d0120ae5345de924f23962c0c1e20abbdff597631f87", size
= 74102, upload-time = "2025-02-15T05:17:22.475Z" },
+ { url =
"https://files.pythonhosted.org/packages/db/a9/25282fdd24493e1022f30b7f5cdf804255c007218b2bfaa655bd7ad34b2d/simplejson-3.20.1-cp313-cp313-win_amd64.whl",
hash =
"sha256:1b9fd15853b90aec3b1739f4471efbf1ac05066a2c7041bf8db821bb73cd2ddc", size
= 75736, upload-time = "2025-02-15T05:17:24.122Z" },
+ { url =
"https://files.pythonhosted.org/packages/4b/30/00f02a0a921556dd5a6db1ef2926a1bc7a8bbbfb1c49cfed68a275b8ab2b/simplejson-3.20.1-py3-none-any.whl",
hash =
"sha256:8a6c1bbac39fa4a79f83cbf1df6ccd8ff7069582a9fd8db1e52cea073bc2c697", size
= 57121, upload-time = "2025-02-15T05:18:51.243Z" },
+]
+
[[package]]
name = "sniffio"
version = "1.3.1"