lplalbert commented on code in PR #415:
URL: https://github.com/apache/hugegraph-ai/pull/415#discussion_r4579516676
##########
hugegraph-llm/src/hugegraph_llm/config/hugegraph_config.py:
##########
@@ -55,6 +55,9 @@ def normalize_graph_url(cls, value):
max_graph_items: int = 30
edge_limit_pre_label: int = 8
+ # graph element config
+ max_element_id_length: int = 256
Review Comment:
Fixed — pushed (2d1c284). Root cause: `max_element_id_length` had no
positivity constraint and `InfoExtract.__init__` took the explicit override
unchecked, while `valid()` rejects ids whose UTF-8 byte length is `>=` the
limit — so a limit of `0` or a negative integer rejects every id and
`_filter_long_id` silently returned the empty graph with warnings.
Structural fix: `HugeGraphConfig` now validates the setting positive in a
field validator, so the configuration fails at load/update time instead of
emptying the graph later; and `InfoExtract.__init__` applies the same check to
the effective limit, so the explicit constructor override is rejected the same
way.
Tests: `test_settings_reject_nonpositive_length_limit` and
`test_explicit_length_limit_must_be_positive` cover `0` and `-1` at both entry
points. Red without the fix ("ValueError not raised").
--
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]