imbajin commented on code in PR #304:
URL:
https://github.com/apache/incubator-hugegraph-ai/pull/304#discussion_r2465625894
##########
hugegraph-llm/src/hugegraph_llm/config/hugegraph_config.py:
##########
@@ -16,28 +16,29 @@
# under the License.
from typing import Optional
+
from .models import BaseConfig
class HugeGraphConfig(BaseConfig):
"""HugeGraph settings"""
# graph server config
- graph_url: Optional[str] = "127.0.0.1:8080"
- graph_name: Optional[str] = "hugegraph"
- graph_user: Optional[str] = "admin"
- graph_pwd: Optional[str] = "xxx"
+ graph_url: str = "127.0.0.1:8080"
Review Comment:
⚠️ **代码风格**: `HugeGraphConfig` 中删除了很多 `Optional` 类型,但某些字段仍然可能为 None。
例如 `graph_space: Optional[str] = None` 保留了 Optional,但其他字段如 `graph_url`
改成了必填。这种不一致可能导致运行时错误。
建议确认每个字段的业务语义:
- 如果是必填配置,应该在初始化时验证
- 如果可选,应该保持 `Optional` 类型
--
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]