-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove pydantic dependency from MLI code #667
Remove pydantic dependency from MLI code #667
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## mli-feature #667 +/- ##
==============================================
Coverage ? 81.46%
==============================================
Files ? 97
Lines ? 7665
Branches ? 0
==============================================
Hits ? 6244
Misses ? 1421
Partials ? 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question/comment. Thanks for the update!
|
||
from smartsim.log import get_logger | ||
|
||
logger = get_logger(__name__) | ||
|
||
|
||
class FeatureStoreKey(BaseModel): | ||
@dataclass(frozen=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want frozen=True
? I'm not familiar with the BaseModel
-- is that frozen by default?
If frozen is not used, then I would assume that we need to add setter methods to check that any updates adhere to non-empty string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseModels
are not frozen by default, but I think we definitely want a frozen dataclass because we don't want FeatureStoreKey
instances to be updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We only used pydantic BaseModels in
FeatureStoreKey
, so I converted that into a dataclass and used_post_init_
to validate that the key and descriptor are not empty strings. I also made the dataclass frozen.