dosubot[bot] commented on issue #326: URL: https://github.com/apache/hugegraph-ai/issues/326#issuecomment-4428179282
<!-- Answer --> Hi @Muawiya-contact — I looked into the current state of `test_metric.py` and it appears the issue you're describing doesn't match what's currently on `main`. The file is [74 lines long](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-python-client/src/tests/api/test_metric.py) and line 72–73 already uses a **direct assertion without a conditional guard**: ```python backend_metrics = self.metrics.get_backend_metrics() self.assertGreater(len(backend_metrics["hugegraph"]), 1) ``` There is no `if "hugegraph" in backend_metrics:` guard in the current implementation [[1]](https://github.com/apache/hugegraph-ai/blob/4dd6a1642f203406403539ef0d96d7d378dfbaef/hugegraph-python-client/src/tests/api/test_metric.py#L72-L73). The assertion will raise a `KeyError` if the `"hugegraph"` key is missing, and will fail if the value has fewer than 2 entries. That said, this assertion is still fairly loose — it only checks that the list/dict has more than 1 element, without validating the actual response shape. Your suggestion to pin the expected 1.7.0 structure is reasonable, and it aligns well with the work tracked in [issue #319](https://github.com/apache/hugegraph-ai/issues/319) (upgrading CI to HugeGraph 1.7 and tightening test assertions), which you're already assigned to. If you'd like to strengthen this as part of that effort, you could: 1. Capture the actual `backend_metrics["hugegraph"]` structure from a 1.7.0 server 2. Assert specific keys/shape rather than just length Could you double-check which branch or fork you're seeing the `if "hugegraph" in backend_metrics:` guard on? It's possible it exists in a local branch or was part of a draft that wasn't merged. _Written by @dosu, approved by imbajin_ <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fhugegraph-ai).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fhugegraph-ai). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fhugegraph-ai&message_id=a8cad899-b7e2-4d81-ad92-04c2ccb401cb) [](https://github.dosu.com/apache/hugegraph-ai?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fhugegraph-ai) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fhugegraph-ai) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
