feat(catalog): preserve and display dataset value scores
Deploy production / deploy (push) Successful in 51s
Deploy production / deploy (push) Successful in 51s
This commit is contained in:
@@ -37,6 +37,7 @@ def catalog_response(request, fields=None):
|
||||
"category": {"name": "基本面"},
|
||||
"subcategory": {"name": "财务报表"},
|
||||
"fieldCount": 123,
|
||||
"valueScore": 2.0,
|
||||
"description": "合成数据,仅用于验收",
|
||||
},
|
||||
{
|
||||
@@ -45,6 +46,7 @@ def catalog_response(request, fields=None):
|
||||
"category": {"name": "新闻"},
|
||||
"subcategory": {"name": "情绪"},
|
||||
"fieldCount": 3,
|
||||
"valueScore": 0.0,
|
||||
},
|
||||
{"id": "TEST_UNKNOWN", "name": "TEST 未分类", "fieldCount": 0},
|
||||
]
|
||||
|
||||
@@ -279,3 +279,17 @@ async def test_dynamic_platform_scopes_and_validation(catalog):
|
||||
runner.client.disconnect()
|
||||
assert (await client.get(BASE + "/scopes")).status_code == 409
|
||||
assert (await search(client))["total"] == 0
|
||||
|
||||
|
||||
async def test_dataset_value_score_survives_sync_and_sorts_null_last(catalog):
|
||||
client, _, _ = catalog
|
||||
assert (await sync(catalog))["status"] == "completed"
|
||||
rows = (await search(client, sort="value_score", direction="desc"))["items"]
|
||||
assert [(row["id"], row["value_score"]) for row in rows] == [
|
||||
("TEST_FIN", 2.0), ("TEST_NEWS", 0.0), ("TEST_UNKNOWN", None)
|
||||
]
|
||||
rows = (await search(client, sort="value_score", direction="asc"))["items"]
|
||||
assert [row["value_score"] for row in rows] == [0.0, 2.0, None]
|
||||
assert (await search(client, "/datasets/TEST_FIN"))["value_score"] == 2.0
|
||||
assert (await search(client, "/datasets/TEST_NEWS"))["value_score"] == 0.0
|
||||
assert (await search(client, "/datasets/TEST_UNKNOWN"))["value_score"] is None
|
||||
|
||||
Reference in New Issue
Block a user