-
Notifications
You must be signed in to change notification settings - Fork 230
Update node serialization/deserialization and other Pydantic issues #6990
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
base: main
Are you sure you want to change the base?
Changes from all commits
7c191fa
4922bb3
167cecf
98af554
2c3e5df
ee17f94
0b37ef6
6873d3c
a4a5b3e
0aa3f65
dd61d77
d7e2901
32634ba
c5a8533
d290eae
31738ff
2c37722
e5e982f
2368afb
adca253
5dbb6b8
7778e78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,8 +167,8 @@ class CalcInfo(DefaultFieldsAttributeDict): | |
max_wallclock_seconds: None | int | ||
max_memory_kb: None | int | ||
rerunnable: bool | ||
retrieve_list: None | list[str | tuple[str, str, str]] | ||
retrieve_temporary_list: None | list[str | tuple[str, str, str]] | ||
retrieve_list: None | list[str | tuple[str, str, int]] | ||
retrieve_temporary_list: None | list[str | tuple[str, str, int]] | ||
Comment on lines
+170
to
+171
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The last argument of the tuple is the depth, which "can be used to control what level of nesting of the source folder hierarchy should be maintained". It is an integer. |
||
local_copy_list: None | list[tuple[str, str, str]] | ||
remote_copy_list: None | list[tuple[str, str, str]] | ||
remote_symlink_list: None | list[tuple[str, str, str]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ class Model(BaseModel): | |
:param short_name: Optional short name to use for an option on a command line interface. | ||
:param option_cls: The :class:`click.Option` class to use to construct the option. | ||
:param orm_class: The class, or entry point name thereof, to which the field should be converted. If this field is | ||
defined, the value of this field should acccept an integer which will automatically be converted to an instance | ||
defined, the value of this field should accept an integer which will automatically be converted to an instance | ||
of said ORM class using ``orm_class.collection.get(id={field_value})``. This is useful, for example, where a | ||
field represents an instance of a different entity, such as an instance of ``User``. The serialized data would | ||
store the ``pk`` of the user, but the ORM entity instance would receive the actual ``User`` instance with that | ||
|
@@ -75,10 +75,10 @@ class Model(BaseModel): | |
:param model_to_orm: Optional callable to convert the value of a field from a model instance to an ORM instance. | ||
:param exclude_to_orm: When set to ``True``, this field value will not be passed to the ORM entity constructor | ||
through ``Entity.from_model``. | ||
:param exclude_to_orm: When set to ``True``, this field value will not be exposed on the CLI command that is | ||
:param exclude_from_cli: When set to ``True``, this field value will not be exposed on the CLI command that is | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
dynamically generated to create a new instance. | ||
:param is_attribute: Whether the field is stored as an attribute. | ||
:param is_subscriptable: Whether the field can be indexed like a list or dictionary. | ||
:param is_attribute: Whether the field is stored as an attribute. Used by `QbFields`. | ||
:param is_subscriptable: Whether the field can be indexed like a list or dictionary. Used by `QbFields`. | ||
""" | ||
field_info = Field(default, **kwargs) | ||
|
||
|
@@ -97,4 +97,9 @@ class Model(BaseModel): | |
if value is not None: | ||
field_info.metadata.append({key: value}) | ||
|
||
if exclude_to_orm: | ||
extra = getattr(field_info, 'json_schema_extra', None) or {} | ||
extra.update({'readOnly': True}) | ||
field_info.json_schema_extra = extra | ||
Comment on lines
+100
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Marking |
||
|
||
return field_info |
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.
DynamicEntryPointCommandGroup
is used also for non-Entity
CLI construction. As such, we need to check if we are creating an Entity (which has the newInputModel
proprty), in which case we pick out theInputModel
to be used for construction.