-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix(): add update mechanism for input cache #626
fix(): add update mechanism for input cache #626
Conversation
@@ -202,19 +202,20 @@ class GenericReferenceCondition(MultiConstructorBaseModel): | |||
==== | |||
""" | |||
|
|||
private_attribute_input_cache: GenericReferenceConditionCache = GenericReferenceConditionCache() |
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.
how does it impact type hints? I think IDE will list the options in order of definition, thus private_... and type_name should be last?
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.
You are right. input_cache will become the first in type hint.
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.
Reverted the ordering of private_attribute_input_cache to make type hint a bit cleaner.
# private_attribute_input_cache has to be defined first for field validators to work. | ||
private_attribute_input_cache: BoxCache = pd.Field(BoxCache(), 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.
oh, interesting. Question how we can modify type hints..
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.
Never mind, I just tested and it seems that even though fields are validated by definition ordering but it is still accessible and has definition (None).
I thought it is like C++ where you reference an uninitialized pointer.
* fix(): add update mechanism for input cache * More unit tests * Fix unit test * Refactor to reduce number of validators * Reverted placement of private_attribute_input_cache
No description provided.