liminal-orm 4.4.6__tar.gz → 4.4.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/PKG-INFO +1 -1
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/compare.py +25 -1
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/generate_files.py +17 -24
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/operations.py +4 -4
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/tag_schema_models.py +32 -26
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_field_type.py +1 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/results_schemas/generate_files.py +18 -14
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/results_schemas/models/results_schema_model.py +0 -1
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/results_schemas/utils.py +3 -1
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/tests/test_entity_schema_compare.py +13 -5
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/pyproject.toml +1 -1
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/.gitignore +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/LICENSE.md +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/README.md +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/.gitignore +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/.lock +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/CACHEDIR.TAG +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/base_dropdown.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/base_operation.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/base_validation_filters.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/compare_operation.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/name_template_parts.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/properties/base_field_properties.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/properties/base_name_template.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/properties/base_schema_properties.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/base/str_enum.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/cli/cli.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/cli/controller.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/cli/live_test_dropdown_migration.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/cli/live_test_entity_schema_migration.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/cli/utils.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/connection/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/connection/benchling_connection.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/connection/benchling_service.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/dropdowns/api.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/dropdowns/compare.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/dropdowns/generate_files.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/dropdowns/operations.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/dropdowns/utils.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/api.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/entity_schema_models.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/entity_schemas/utils.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_api_field_type.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_entity_type.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_folder_item_type.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_naming_strategy.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/benchling_sequence_type.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/name_template_part_type.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/enums/sequence_constraint.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/external/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/mappers.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/migrate/components.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/migrate/revision.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/migrate/revisions_timeline.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base_model.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base_results_model.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base_tables/registry_entity.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base_tables/schema.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/base_tables/user.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/column.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/mixins.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/name_template.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/name_template_parts.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/relationship.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/results_schema_properties.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/orm/schema_properties.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/py.typed +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/pyvenv.cfg +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/kernel.json +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-32x32.png +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-64x64.png +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-svg.svg +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/man/man1/ipython.1 +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/tests/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/tests/conftest.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/tests/from benchling_sdk.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/tests/test_dropdown_compare.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/unit_dictionary/utils.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/utils.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/validation/__init__.py +0 -0
- {liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/validation/validation_severity.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: liminal-orm
|
|
3
|
-
Version: 4.4.
|
|
3
|
+
Version: 4.4.8
|
|
4
4
|
Summary: An ORM and toolkit that builds on top of Benchling's platform to keep your schemas and downstream code dependencies in sync.
|
|
5
5
|
Project-URL: Homepage, https://github.com/dynotx/liminal-orm
|
|
6
6
|
Project-URL: Repository, https://github.com/dynotx/liminal-orm
|
|
@@ -232,6 +232,28 @@ def compare_entity_schemas(
|
|
|
232
232
|
)
|
|
233
233
|
)
|
|
234
234
|
if benchling_schema_props != model.__schema_properties__:
|
|
235
|
+
needs_constraint_clear = (
|
|
236
|
+
benchling_schema_props.constraint_fields
|
|
237
|
+
!= model.__schema_properties__.constraint_fields
|
|
238
|
+
and len(benchling_schema_props.constraint_fields) > 0
|
|
239
|
+
)
|
|
240
|
+
if needs_constraint_clear:
|
|
241
|
+
ops.append(
|
|
242
|
+
CompareOperation(
|
|
243
|
+
op=UpdateEntitySchema(
|
|
244
|
+
model.__schema_properties__.warehouse_name,
|
|
245
|
+
BaseSchemaProperties(constraint_fields=set()),
|
|
246
|
+
),
|
|
247
|
+
reverse_op=UpdateEntitySchema(
|
|
248
|
+
model.__schema_properties__.warehouse_name,
|
|
249
|
+
BaseSchemaProperties(
|
|
250
|
+
**model.__schema_properties__.merge(
|
|
251
|
+
benchling_schema_props
|
|
252
|
+
)
|
|
253
|
+
),
|
|
254
|
+
),
|
|
255
|
+
)
|
|
256
|
+
)
|
|
235
257
|
ops.append(
|
|
236
258
|
CompareOperation(
|
|
237
259
|
op=UpdateEntitySchema(
|
|
@@ -244,7 +266,9 @@ def compare_entity_schemas(
|
|
|
244
266
|
),
|
|
245
267
|
reverse_op=UpdateEntitySchema(
|
|
246
268
|
model.__schema_properties__.warehouse_name,
|
|
247
|
-
BaseSchemaProperties(
|
|
269
|
+
BaseSchemaProperties(constraint_fields=set())
|
|
270
|
+
if needs_constraint_clear
|
|
271
|
+
else BaseSchemaProperties(
|
|
248
272
|
**model.__schema_properties__.merge(
|
|
249
273
|
benchling_schema_props
|
|
250
274
|
)
|
|
@@ -3,7 +3,6 @@ from pathlib import Path
|
|
|
3
3
|
|
|
4
4
|
from rich import print
|
|
5
5
|
|
|
6
|
-
from liminal.base.base_dropdown import BaseDropdown
|
|
7
6
|
from liminal.connection.benchling_service import BenchlingService
|
|
8
7
|
from liminal.dropdowns.utils import get_benchling_dropdowns_dict
|
|
9
8
|
from liminal.entity_schemas.utils import get_converted_tag_schemas
|
|
@@ -140,20 +139,22 @@ def generate_all_entity_schema_files(
|
|
|
140
139
|
col.type in BenchlingFieldType.get_entity_link_types()
|
|
141
140
|
and col.entity_link is not None
|
|
142
141
|
):
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
142
|
+
entity_classname = wh_name_to_classname.get(col.entity_link)
|
|
143
|
+
if entity_classname is not None:
|
|
144
|
+
if not col.is_multi:
|
|
145
|
+
relationship_strings.append(
|
|
146
|
+
f"""{TAB}{col_name}_entity = single_relationship("{wh_name_to_classname[col.entity_link]}", {col_name})"""
|
|
147
|
+
)
|
|
148
|
+
import_strings.append(
|
|
149
|
+
"from liminal.orm.relationship import single_relationship"
|
|
150
|
+
)
|
|
151
|
+
else:
|
|
152
|
+
relationship_strings.append(
|
|
153
|
+
f"""{TAB}{col_name}_entities = multi_relationship("{wh_name_to_classname[col.entity_link]}", {col_name})"""
|
|
154
|
+
)
|
|
155
|
+
import_strings.append(
|
|
156
|
+
"from liminal.orm.relationship import multi_relationship"
|
|
157
|
+
)
|
|
157
158
|
for col_name, col in columns.items():
|
|
158
159
|
if not col.required and col.type:
|
|
159
160
|
init_strings.append(
|
|
@@ -241,15 +242,7 @@ class {classname}(BaseModel, {get_entity_mixin(schema_properties.entity_type)}):
|
|
|
241
242
|
def _get_dropdown_name_to_classname_map(
|
|
242
243
|
benchling_service: BenchlingService,
|
|
243
244
|
) -> dict[str, str]:
|
|
244
|
-
"""Gets the dropdown name to classname map.
|
|
245
|
-
If there are dropdowns imported, use BenchlingDropdown.get_all_subclasses()
|
|
246
|
-
Otherwise, it will query for Benchling dropdowns and use those.
|
|
247
|
-
"""
|
|
248
|
-
if len(BaseDropdown.get_all_subclasses()) > 0:
|
|
249
|
-
return {
|
|
250
|
-
dropdown.__benchling_name__: dropdown.__name__
|
|
251
|
-
for dropdown in BaseDropdown.get_all_subclasses()
|
|
252
|
-
}
|
|
245
|
+
"""Gets the dropdown name to classname map by querying Benchling dropdowns and using the dropdown name to create the classname."""
|
|
253
246
|
benchling_dropdowns = get_benchling_dropdowns_dict(benchling_service)
|
|
254
247
|
return {
|
|
255
248
|
dropdown_name: to_pascal_case(dropdown_name)
|
|
@@ -18,7 +18,6 @@ from liminal.entity_schemas.entity_schema_models import CreateEntitySchemaModel
|
|
|
18
18
|
from liminal.entity_schemas.tag_schema_models import (
|
|
19
19
|
CreateTagSchemaFieldModel,
|
|
20
20
|
TagSchemaModel,
|
|
21
|
-
UpdateTagSchemaModel,
|
|
22
21
|
)
|
|
23
22
|
from liminal.entity_schemas.utils import (
|
|
24
23
|
convert_tag_schema_field_to_field_properties,
|
|
@@ -217,11 +216,12 @@ class UpdateEntitySchema(BaseOperation):
|
|
|
217
216
|
|
|
218
217
|
def execute(self, benchling_service: BenchlingService) -> dict[str, Any]:
|
|
219
218
|
tag_schema = self._validate(benchling_service)
|
|
220
|
-
|
|
219
|
+
update = tag_schema.to_update_tag_schema_model(
|
|
221
220
|
self.update_props.model_dump(exclude_unset=True)
|
|
222
221
|
)
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
return update_tag_schema(
|
|
223
|
+
benchling_service, tag_schema.id, update.model_dump(exclude_unset=True)
|
|
224
|
+
)
|
|
225
225
|
|
|
226
226
|
def describe_operation(self) -> str:
|
|
227
227
|
return f"{self.wh_schema_name}: Updating schema properties to: {str(self.update_props)}."
|
|
@@ -473,28 +473,39 @@ class TagSchemaModel(BaseModel):
|
|
|
473
473
|
part.to_name_template_part(self.fields) for part in self.nameTemplateParts
|
|
474
474
|
]
|
|
475
475
|
|
|
476
|
-
def
|
|
477
|
-
|
|
476
|
+
def to_update_tag_schema_model(
|
|
477
|
+
self, update_diff: dict[str, Any]
|
|
478
|
+
) -> UpdateTagSchemaModel:
|
|
479
|
+
"""Converts the tag schema model to an UpdateTagSchemaModel, with only the updated properties."""
|
|
478
480
|
update_diff_names = list(update_diff.keys())
|
|
479
481
|
update_props = BaseSchemaProperties(**update_diff)
|
|
482
|
+
update_tag_schema_model = UpdateTagSchemaModel()
|
|
480
483
|
if update_props.entity_type and "entity_type" in update_diff_names:
|
|
481
484
|
folder_item_type, sequence_type = convert_entity_type_to_api_entity_type(
|
|
482
485
|
update_props.entity_type
|
|
483
486
|
)
|
|
484
|
-
|
|
485
|
-
|
|
487
|
+
update_tag_schema_model.folderItemType = folder_item_type
|
|
488
|
+
update_tag_schema_model.sequenceType = sequence_type
|
|
486
489
|
if "naming_strategies" in update_diff_names:
|
|
487
|
-
|
|
490
|
+
update_tag_schema_model.labelingStrategies = [
|
|
491
|
+
o.value for o in update_props.naming_strategies
|
|
492
|
+
]
|
|
488
493
|
if "mixture_schema_config" in update_diff_names:
|
|
489
|
-
|
|
494
|
+
update_tag_schema_model.mixtureSchemaConfig = (
|
|
495
|
+
update_props.mixture_schema_config
|
|
496
|
+
)
|
|
490
497
|
if "use_registry_id_as_label" in update_diff_names:
|
|
491
|
-
|
|
498
|
+
update_tag_schema_model.useOrganizationCollectionAliasForDisplayLabel = (
|
|
492
499
|
update_props.use_registry_id_as_label
|
|
493
500
|
)
|
|
494
501
|
if "include_registry_id_in_chips" in update_diff_names:
|
|
495
|
-
|
|
502
|
+
update_tag_schema_model.includeRegistryIdInChips = (
|
|
503
|
+
update_props.include_registry_id_in_chips
|
|
504
|
+
)
|
|
496
505
|
if "show_bases_in_expanded_view" in update_diff_names:
|
|
497
|
-
|
|
506
|
+
update_tag_schema_model.showResidues = (
|
|
507
|
+
update_props.show_bases_in_expanded_view
|
|
508
|
+
)
|
|
498
509
|
|
|
499
510
|
if "constraint_fields" in update_diff_names:
|
|
500
511
|
if update_props.constraint_fields:
|
|
@@ -516,25 +527,20 @@ class TagSchemaModel(BaseModel):
|
|
|
516
527
|
for f in self.fields
|
|
517
528
|
if f.systemName in update_props.constraint_fields
|
|
518
529
|
]
|
|
519
|
-
|
|
520
|
-
|
|
530
|
+
update_tag_schema_model.constraint = (
|
|
531
|
+
TagSchemaConstraint.from_constraint_fields(
|
|
532
|
+
constraint_fields, sequence_constraint
|
|
533
|
+
)
|
|
521
534
|
)
|
|
522
535
|
else:
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
if "warehouse_name" in update_diff_names
|
|
532
|
-
else self.sqlIdentifier
|
|
533
|
-
)
|
|
534
|
-
assert type(set_sql_identifier) is str
|
|
535
|
-
self.sqlIdentifier = set_sql_identifier
|
|
536
|
-
self.name = update_props.name if "name" in update_diff_names else self.name
|
|
537
|
-
return self
|
|
536
|
+
update_tag_schema_model.constraint = None
|
|
537
|
+
if "prefix" in update_diff_names:
|
|
538
|
+
update_tag_schema_model.prefix = update_props.prefix
|
|
539
|
+
if "warehouse_name" in update_diff_names:
|
|
540
|
+
update_tag_schema_model.sqlIdentifier = update_props.warehouse_name
|
|
541
|
+
if "name" in update_diff_names:
|
|
542
|
+
update_tag_schema_model.name = update_props.name
|
|
543
|
+
return update_tag_schema_model
|
|
538
544
|
|
|
539
545
|
def update_name_template(
|
|
540
546
|
self, update_name_template: BaseNameTemplate
|
|
@@ -97,20 +97,24 @@ def generate_all_results_schema_files(
|
|
|
97
97
|
col.type in BenchlingFieldType.get_entity_link_types()
|
|
98
98
|
and col.entity_link is not None
|
|
99
99
|
):
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
entity_classname = entity_schemas_wh_name_to_classname.get(
|
|
101
|
+
col.entity_link
|
|
102
|
+
)
|
|
103
|
+
if entity_classname is not None:
|
|
104
|
+
if not col.is_multi:
|
|
105
|
+
relationship_strings.append(
|
|
106
|
+
f"""{TAB}{col_name}_entity = single_relationship("{entity_classname}", {col_name})"""
|
|
107
|
+
)
|
|
108
|
+
import_strings.append(
|
|
109
|
+
"from liminal.orm.relationship import single_relationship"
|
|
110
|
+
)
|
|
111
|
+
else:
|
|
112
|
+
relationship_strings.append(
|
|
113
|
+
f"""{TAB}{col_name}_entities = multi_relationship("{entity_classname}", {col_name})"""
|
|
114
|
+
)
|
|
115
|
+
import_strings.append(
|
|
116
|
+
"from liminal.orm.relationship import multi_relationship"
|
|
117
|
+
)
|
|
114
118
|
for col_name, col in field_properties_dict.items():
|
|
115
119
|
if not col.required and col.type:
|
|
116
120
|
init_strings.append(
|
|
@@ -12,7 +12,7 @@ from liminal.unit_dictionary.utils import get_unit_id_to_name_map
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def get_converted_results_schemas(
|
|
15
|
-
benchling_service: BenchlingService,
|
|
15
|
+
benchling_service: BenchlingService, include_archived: bool = False
|
|
16
16
|
) -> list[tuple[ResultsSchemaProperties, dict[str, BaseFieldProperties]]]:
|
|
17
17
|
"""This functions gets all Results Schema schemas from Benchling and converts them to our internal representation of a schema and its fields.
|
|
18
18
|
It parses the Results Schema and creates ResultsSchemaProperties and a list of FieldProperties for each field in the schema.
|
|
@@ -21,6 +21,8 @@ def get_converted_results_schemas(
|
|
|
21
21
|
dropdowns_map = get_benchling_dropdown_id_name_map(benchling_service)
|
|
22
22
|
unit_id_to_name_map = get_unit_id_to_name_map(benchling_service)
|
|
23
23
|
results_schemas_list = []
|
|
24
|
+
if not include_archived:
|
|
25
|
+
results_schemas = [s for s in results_schemas if not s.archiveRecord]
|
|
24
26
|
for schema in results_schemas:
|
|
25
27
|
schema_properties = ResultsSchemaProperties(
|
|
26
28
|
name=schema.name,
|
|
@@ -361,13 +361,21 @@ class TestCompareEntitySchemas:
|
|
|
361
361
|
benchling_mismatch_constraint_fields
|
|
362
362
|
)
|
|
363
363
|
invalid_models = compare_entity_schemas(mock_benchling_sdk)
|
|
364
|
-
assert len(invalid_models["mock_entity"]) ==
|
|
364
|
+
assert len(invalid_models["mock_entity"]) == 2
|
|
365
365
|
assert isinstance(invalid_models["mock_entity"][0].op, UpdateEntitySchema)
|
|
366
|
-
|
|
366
|
+
clear_props_dict = invalid_models["mock_entity"][
|
|
367
367
|
0
|
|
368
|
-
].op.update_props.
|
|
369
|
-
|
|
370
|
-
|
|
368
|
+
].op.update_props.model_dump(exclude_unset=True)
|
|
369
|
+
assert clear_props_dict == {"constraint_fields": set()}
|
|
370
|
+
assert isinstance(invalid_models["mock_entity"][1].op, UpdateEntitySchema)
|
|
371
|
+
update_props_dict = invalid_models["mock_entity"][
|
|
372
|
+
1
|
|
373
|
+
].op.update_props.model_dump(exclude_unset=True)
|
|
374
|
+
assert update_props_dict == {
|
|
375
|
+
"constraint_fields": {
|
|
376
|
+
"string_field_req",
|
|
377
|
+
"enum_field",
|
|
378
|
+
},
|
|
371
379
|
}
|
|
372
380
|
|
|
373
381
|
# Test when the Benchling schema has different display naming fields
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "liminal-orm"
|
|
3
|
-
version = "4.4.
|
|
3
|
+
version = "4.4.8"
|
|
4
4
|
description = "An ORM and toolkit that builds on top of Benchling's platform to keep your schemas and downstream code dependencies in sync."
|
|
5
5
|
authors = [{ name = "DynoTx Open Source", email = "opensource@dynotx.com" }]
|
|
6
6
|
requires-python = ">=3.9,<4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-32x32.png
RENAMED
|
File without changes
|
{liminal_orm-4.4.6 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-64x64.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|