liminal-orm 4.4.7__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.7 → liminal_orm-4.4.8}/PKG-INFO +1 -1
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/compare.py +25 -1
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/operations.py +4 -4
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/tag_schema_models.py +32 -26
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_field_type.py +1 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/tests/test_entity_schema_compare.py +13 -5
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/pyproject.toml +1 -1
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/.gitignore +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/LICENSE.md +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/README.md +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/.gitignore +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/.lock +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/CACHEDIR.TAG +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/__init__.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/base_dropdown.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/base_operation.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/base_validation_filters.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/compare_operation.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/name_template_parts.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/properties/base_field_properties.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/properties/base_name_template.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/properties/base_schema_properties.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/base/str_enum.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/cli/cli.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/cli/controller.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/cli/live_test_dropdown_migration.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/cli/live_test_entity_schema_migration.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/cli/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/connection/__init__.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/connection/benchling_connection.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/connection/benchling_service.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/dropdowns/api.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/dropdowns/compare.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/dropdowns/generate_files.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/dropdowns/operations.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/dropdowns/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/api.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/entity_schema_models.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/generate_files.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/entity_schemas/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/__init__.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_api_field_type.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_entity_type.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_folder_item_type.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_naming_strategy.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/benchling_sequence_type.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/name_template_part_type.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/enums/sequence_constraint.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/external/__init__.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/mappers.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/migrate/components.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/migrate/revision.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/migrate/revisions_timeline.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base_model.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base_results_model.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base_tables/registry_entity.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base_tables/schema.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/base_tables/user.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/column.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/mixins.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/name_template.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/name_template_parts.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/relationship.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/results_schema_properties.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/orm/schema_properties.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/py.typed +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/pyvenv.cfg +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/results_schemas/generate_files.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/results_schemas/models/results_schema_model.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/results_schemas/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/kernel.json +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-32x32.png +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-64x64.png +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-svg.svg +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/man/man1/ipython.1 +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/tests/__init__.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/tests/conftest.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/tests/from benchling_sdk.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/tests/test_dropdown_compare.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/unit_dictionary/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/utils.py +0 -0
- {liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/validation/__init__.py +0 -0
- {liminal_orm-4.4.7 → 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
|
)
|
|
@@ -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
|
|
@@ -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
|
|
File without changes
|
{liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/results_schemas/models/results_schema_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{liminal_orm-4.4.7 → liminal_orm-4.4.8}/liminal/share/jupyter/kernels/python3/logo-32x32.png
RENAMED
|
File without changes
|
{liminal_orm-4.4.7 → 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
|