From ec3ac948a4b52563ebf50933220e599aff1c558b Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Thu, 11 Jul 2024 15:59:33 +0200 Subject: [PATCH] Fix docgen circular import --- python/hsfs/serving_key.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/python/hsfs/serving_key.py b/python/hsfs/serving_key.py index 699b55c12..dfe2d2a3d 100644 --- a/python/hsfs/serving_key.py +++ b/python/hsfs/serving_key.py @@ -16,11 +16,13 @@ from __future__ import annotations import json -from typing import Any, Dict, List, Optional, Union +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union import humps -from hsfs import feature_group as fg_mod -from hsfs import util + + +if TYPE_CHECKING: + from hsfs import feature_group as fg_mod class ServingKey: @@ -84,6 +86,8 @@ def to_dict(self) -> Dict[str, Any]: } def __repr__(self) -> str: + from hsfs import util + return json.dumps(self, cls=util.FeatureStoreEncoder) @property