liminal-orm 2.0.3a1__tar.gz → 2.0.4__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-2.0.3a1 → liminal_orm-2.0.4}/PKG-INFO +1 -1
- liminal_orm-2.0.4/liminal/.DS_Store +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/base.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/base_dropdown.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/base_operation.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/base_validation_filters.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/benchling_base_model.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/benchling_column.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/benchling_dropdown.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/benchling_field_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/benchling_schema_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/callable_operation.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/column.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/compare_operation.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/field_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/name_template_components.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/name_template_parts.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/schema_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/str_enum.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/unset.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/__pycache__/user.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/base_operation.py +7 -7
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/NoDropdown.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/base_field_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/base_name_template.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/base_schema_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/field_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/base/properties/__pycache__/schema_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/cli/__pycache__/cli.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/cli/__pycache__/controller.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/cli/__pycache__/live_test_dropdown_migration.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/cli/__pycache__/live_test_entity_schema_migration.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/connection/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/connection/__pycache__/benchling_connection.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/connection/__pycache__/benchling_service.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/dropdowns/__pycache__/api.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/dropdowns/__pycache__/compare.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/dropdowns/__pycache__/generate_files.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/dropdowns/__pycache__/operations.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/dropdowns/__pycache__/utils.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/api.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/compare.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/entity_schema_models.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/generate_files.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/operations.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/schemas.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/tag_schema_models.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/entity_schemas/__pycache__/utils.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/compare.py +40 -21
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/generate_files.py +1 -1
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/tag_schema_models.py +1 -1
- liminal_orm-2.0.4/liminal/enums/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_api_field_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_dropdown.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_entity_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_enum.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_field_api_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_field_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_folder_item_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_naming_strategy.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_report_level.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/benchling_sequence_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/name_template_part_type.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/str_enum.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/enums/__pycache__/undefined.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_field_type.py +4 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_naming_strategy.py +1 -0
- liminal_orm-2.0.4/liminal/external/__pycache__/__init__.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/mappers.py +5 -2
- liminal_orm-2.0.4/liminal/migrate/__pycache__/components.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/migrate/__pycache__/revision.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/migrate/__pycache__/revisions_timeline.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/migrate/__pycache__/utils.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/base.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/base_model.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/column.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/mixins.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/name_template.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/name_template_parts.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/relationship.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/schema_properties.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/__pycache__/user.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/base_tables/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/base_tables/__pycache__/registry_entity.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/base_tables/__pycache__/schema.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/orm/base_tables/__pycache__/user.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/column.py +5 -5
- liminal_orm-2.0.4/liminal/tests/.DS_Store +0 -0
- liminal_orm-2.0.4/liminal/tests/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/tests/__pycache__/conftest.cpython-310-pytest-8.3.3.pyc +0 -0
- liminal_orm-2.0.4/liminal/tests/__pycache__/test_dropdown_compare.cpython-310-pytest-8.3.3.pyc +0 -0
- liminal_orm-2.0.4/liminal/tests/__pycache__/test_entity_schema_compare.cpython-310-pytest-8.3.3.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/validation/__init__.py +2 -9
- liminal_orm-2.0.4/liminal/validation/__pycache__/__init__.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/validation/__pycache__/validation_report_level.cpython-310.pyc +0 -0
- liminal_orm-2.0.4/liminal/validation/__pycache__/validation_severity.cpython-310.pyc +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/pyproject.toml +1 -1
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/LICENSE.md +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/README.md +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/__init__.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/base_dropdown.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/base_validation_filters.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/compare_operation.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/name_template_parts.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/properties/base_field_properties.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/properties/base_name_template.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/properties/base_schema_properties.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/base/str_enum.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/cli/cli.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/cli/controller.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/cli/live_test_dropdown_migration.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/cli/live_test_entity_schema_migration.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/connection/__init__.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/connection/benchling_connection.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/connection/benchling_service.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/dropdowns/api.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/dropdowns/compare.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/dropdowns/generate_files.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/dropdowns/operations.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/dropdowns/utils.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/api.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/entity_schema_models.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/operations.py +7 -7
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/entity_schemas/utils.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/__init__.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_api_field_type.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_entity_type.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_folder_item_type.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/benchling_sequence_type.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/enums/name_template_part_type.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/external/__init__.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/migrate/components.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/migrate/revision.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/migrate/revisions_timeline.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/migrate/utils.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/base.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/base_model.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/base_tables/registry_entity.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/base_tables/schema.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/base_tables/user.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/mixins.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/name_template.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/name_template_parts.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/relationship.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/orm/schema_properties.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/py.typed +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/tests/__init__.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/tests/conftest.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/tests/from benchling_sdk.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/tests/test_dropdown_compare.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/tests/test_entity_schema_compare.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/utils.py +0 -0
- {liminal_orm-2.0.3a1 → liminal_orm-2.0.4}/liminal/validation/validation_severity.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: liminal-orm
|
3
|
-
Version: 2.0.
|
3
|
+
Version: 2.0.4
|
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
|
Home-page: https://github.com/dynotx/liminal-orm
|
6
6
|
Author: DynoTx Open Source
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -13,13 +13,13 @@ Order of operations based on order class var:
|
|
13
13
|
6. ArchiveDropdownOption
|
14
14
|
7. ReorderDropdownOptions
|
15
15
|
8. CreateSchema
|
16
|
-
9.
|
17
|
-
10.
|
18
|
-
11.
|
19
|
-
12.
|
20
|
-
13.
|
21
|
-
14.
|
22
|
-
15.
|
16
|
+
9. UpdateEntitySchemaNameTemplate
|
17
|
+
10. UpdateSchema
|
18
|
+
11. UnarchiveSchema
|
19
|
+
12. CreateField
|
20
|
+
13. UnarchiveField
|
21
|
+
14. UpdateField
|
22
|
+
15. ArchiveField
|
23
23
|
16. ReorderFields
|
24
24
|
17. ArchiveSchema
|
25
25
|
18. ArchiveDropdown
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -18,6 +18,7 @@ from liminal.entity_schemas.operations import (
|
|
18
18
|
UpdateEntitySchemaNameTemplate,
|
19
19
|
)
|
20
20
|
from liminal.entity_schemas.utils import get_converted_tag_schemas
|
21
|
+
from liminal.enums.benchling_naming_strategy import BenchlingNamingStrategy
|
21
22
|
from liminal.orm.base_model import BaseModel
|
22
23
|
from liminal.orm.column import Column
|
23
24
|
from liminal.utils import to_snake_case
|
@@ -275,6 +276,16 @@ def compare_entity_schemas(
|
|
275
276
|
col.properties.set_warehouse_name(wh_name)
|
276
277
|
for wh_name, col in model_columns.items()
|
277
278
|
]
|
279
|
+
template_based_naming_strategies = {
|
280
|
+
s
|
281
|
+
for s in model.__schema_properties__.naming_strategies
|
282
|
+
if BenchlingNamingStrategy.is_template_based(s)
|
283
|
+
}
|
284
|
+
model.__schema_properties__.naming_strategies = {
|
285
|
+
s
|
286
|
+
for s in model.__schema_properties__.naming_strategies
|
287
|
+
if not BenchlingNamingStrategy.is_template_based(s)
|
288
|
+
}
|
278
289
|
ops.append(
|
279
290
|
CompareOperation(
|
280
291
|
op=CreateEntitySchema(
|
@@ -288,28 +299,10 @@ def compare_entity_schemas(
|
|
288
299
|
),
|
289
300
|
)
|
290
301
|
)
|
291
|
-
benchling_given_wh_name = to_snake_case(model.__schema_properties__.name)
|
292
|
-
if model.__schema_properties__.warehouse_name != benchling_given_wh_name:
|
293
|
-
ops.append(
|
294
|
-
CompareOperation(
|
295
|
-
op=UpdateEntitySchema(
|
296
|
-
benchling_given_wh_name,
|
297
|
-
BaseSchemaProperties(
|
298
|
-
warehouse_name=model.__schema_properties__.warehouse_name
|
299
|
-
),
|
300
|
-
),
|
301
|
-
reverse_op=UpdateEntitySchema(
|
302
|
-
model.__schema_properties__.warehouse_name,
|
303
|
-
BaseSchemaProperties(
|
304
|
-
warehouse_name=benchling_given_wh_name
|
305
|
-
),
|
306
|
-
),
|
307
|
-
)
|
308
|
-
)
|
309
302
|
benchling_given_name_template = BaseNameTemplate(
|
310
303
|
parts=[], order_name_parts_by_sequence=False
|
311
304
|
)
|
312
|
-
if
|
305
|
+
if benchling_given_name_template != model.__name_template__:
|
313
306
|
ops.append(
|
314
307
|
CompareOperation(
|
315
308
|
op=UpdateEntitySchemaNameTemplate(
|
@@ -323,13 +316,39 @@ def compare_entity_schemas(
|
|
323
316
|
reverse_op=UpdateEntitySchemaNameTemplate(
|
324
317
|
model.__schema_properties__.warehouse_name,
|
325
318
|
BaseNameTemplate(
|
326
|
-
**
|
327
|
-
|
319
|
+
**model.__name_template__.merge(
|
320
|
+
benchling_given_name_template
|
328
321
|
)
|
329
322
|
),
|
330
323
|
),
|
331
324
|
)
|
332
325
|
)
|
326
|
+
benchling_given_wh_name = to_snake_case(model.__schema_properties__.name)
|
327
|
+
new_schema_props = BaseSchemaProperties()
|
328
|
+
rollback_schema_props = BaseSchemaProperties()
|
329
|
+
if model.__schema_properties__.warehouse_name != benchling_given_wh_name:
|
330
|
+
new_schema_props.warehouse_name = (
|
331
|
+
model.__schema_properties__.warehouse_name
|
332
|
+
)
|
333
|
+
rollback_schema_props.warehouse_name = benchling_given_wh_name
|
334
|
+
if template_based_naming_strategies:
|
335
|
+
new_schema_props.naming_strategies = template_based_naming_strategies
|
336
|
+
rollback_schema_props.naming_strategies = (
|
337
|
+
model.__schema_properties__.naming_strategies
|
338
|
+
)
|
339
|
+
if new_schema_props.model_dump(exclude_unset=True) != {}:
|
340
|
+
ops.append(
|
341
|
+
CompareOperation(
|
342
|
+
op=UpdateEntitySchema(
|
343
|
+
benchling_given_wh_name,
|
344
|
+
new_schema_props,
|
345
|
+
),
|
346
|
+
reverse_op=UpdateEntitySchema(
|
347
|
+
model.__schema_properties__.warehouse_name,
|
348
|
+
rollback_schema_props,
|
349
|
+
),
|
350
|
+
)
|
351
|
+
)
|
333
352
|
|
334
353
|
model_operations[model.__schema_properties__.warehouse_name] = ops
|
335
354
|
running_benchling_schema_names = [
|
@@ -105,7 +105,7 @@ def generate_all_entity_schema_files(
|
|
105
105
|
if not has_date:
|
106
106
|
import_strings.append("from datetime import datetime")
|
107
107
|
if (
|
108
|
-
col.type
|
108
|
+
col.type in BenchlingFieldType.get_entity_link_types()
|
109
109
|
and col.entity_link is not None
|
110
110
|
):
|
111
111
|
if not col.is_multi:
|
@@ -164,7 +164,7 @@ class CreateTagSchemaFieldModel(BaseModel):
|
|
164
164
|
)
|
165
165
|
|
166
166
|
tagSchema = None
|
167
|
-
if new_props.type
|
167
|
+
if new_props.type in BenchlingFieldType.get_entity_link_types():
|
168
168
|
if new_props.entity_link is not None:
|
169
169
|
if benchling_service is None:
|
170
170
|
raise ValueError(
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -11,6 +11,7 @@ class BenchlingNamingStrategy(StrEnum):
|
|
11
11
|
)
|
12
12
|
RENAME_WITH_TEMPLATE_WITH_ALIAS = "SET_FROM_NAME_PARTS" # Generate new registry IDs, rename according to name template, and keep old name as alias
|
13
13
|
REPLACE_NAMES_WITH_TEMPLATE = "REPLACE_NAMES_FROM_PARTS" # Generate new registry IDs, and replace name according to name template
|
14
|
+
KEEP_NAMES = "KEEP_NAMES" # Keeps the original name
|
14
15
|
|
15
16
|
@classmethod
|
16
17
|
def is_template_based(cls, strategy: BenchlingNamingStrategy) -> bool:
|
Binary file
|
@@ -22,6 +22,8 @@ def convert_benchling_type_to_python_type(benchling_type: BenchlingFieldType) ->
|
|
22
22
|
BenchlingFieldType.BLOB_LINK: dict[str, Any],
|
23
23
|
BenchlingFieldType.CUSTOM_ENTITY_LINK: str,
|
24
24
|
BenchlingFieldType.DNA_SEQUENCE_LINK: str,
|
25
|
+
BenchlingFieldType.AA_SEQUENCE_LINK: str,
|
26
|
+
BenchlingFieldType.TRANSLATION_LINK: str,
|
25
27
|
BenchlingFieldType.DROPDOWN: str,
|
26
28
|
BenchlingFieldType.ENTITY_LINK: str,
|
27
29
|
BenchlingFieldType.ENTRY_LINK: str,
|
@@ -48,6 +50,8 @@ def convert_benchling_type_to_sql_alchemy_type(
|
|
48
50
|
BenchlingFieldType.BLOB_LINK: JSON,
|
49
51
|
BenchlingFieldType.CUSTOM_ENTITY_LINK: String,
|
50
52
|
BenchlingFieldType.DNA_SEQUENCE_LINK: String,
|
53
|
+
BenchlingFieldType.AA_SEQUENCE_LINK: String,
|
54
|
+
BenchlingFieldType.TRANSLATION_LINK: String,
|
51
55
|
BenchlingFieldType.DROPDOWN: String,
|
52
56
|
BenchlingFieldType.ENTITY_LINK: String,
|
53
57
|
BenchlingFieldType.ENTRY_LINK: String,
|
@@ -55,7 +59,6 @@ def convert_benchling_type_to_sql_alchemy_type(
|
|
55
59
|
BenchlingFieldType.STORAGE_LINK: String,
|
56
60
|
BenchlingFieldType.PART_LINK: String,
|
57
61
|
BenchlingFieldType.MIXTURE_LINK: String,
|
58
|
-
BenchlingFieldType.AA_SEQUENCE_LINK: String,
|
59
62
|
BenchlingFieldType.TEXT: String,
|
60
63
|
}
|
61
64
|
if benchling_type in benchling_to_sql_alchemy_type_map:
|
@@ -141,7 +144,7 @@ def convert_api_field_type_to_field_type(
|
|
141
144
|
): BenchlingFieldType.PART_LINK,
|
142
145
|
(
|
143
146
|
BenchlingAPIFieldType.TRANSLATION_LINK,
|
144
|
-
|
147
|
+
None,
|
145
148
|
): BenchlingFieldType.TRANSLATION_LINK,
|
146
149
|
(BenchlingAPIFieldType.FILE_LINK, None): BenchlingFieldType.ENTITY_LINK,
|
147
150
|
(BenchlingAPIFieldType.FLOAT, None): BenchlingFieldType.DECIMAL,
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -73,19 +73,19 @@ class Column(SqlColumn):
|
|
73
73
|
raise ValueError("Dropdown can only be set if the field type is DROPDOWN.")
|
74
74
|
if dropdown is None and type == BenchlingFieldType.DROPDOWN:
|
75
75
|
raise ValueError("Dropdown must be set if the field type is DROPDOWN.")
|
76
|
-
if entity_link and type
|
76
|
+
if entity_link and type not in BenchlingFieldType.get_entity_link_types():
|
77
77
|
raise ValueError(
|
78
|
-
"Entity link can only be set if the field type is ENTITY_LINK."
|
78
|
+
"Entity link can only be set if the field type is ENTITY_LINK or TRANSLATION_LINK."
|
79
79
|
)
|
80
|
-
if parent_link and type
|
80
|
+
if parent_link and type not in BenchlingFieldType.get_entity_link_types():
|
81
81
|
raise ValueError(
|
82
|
-
"Parent link can only be set if the field type is ENTITY_LINK."
|
82
|
+
"Parent link can only be set if the field type is ENTITY_LINK or TRANSLATION_LINK."
|
83
83
|
)
|
84
84
|
if type in BenchlingFieldType.get_non_multi_select_types() and is_multi is True:
|
85
85
|
raise ValueError(f"Field type {type} cannot have multi-value set as True.")
|
86
86
|
self.sqlalchemy_type = sqlalchemy_type
|
87
87
|
foreign_key = None
|
88
|
-
if type
|
88
|
+
if type in BenchlingFieldType.get_entity_link_types() and entity_link:
|
89
89
|
foreign_key = ForeignKey(f"{entity_link}$raw.id")
|
90
90
|
if _warehouse_name:
|
91
91
|
kwargs["name"] = _warehouse_name
|
Binary file
|
Binary file
|
liminal_orm-2.0.4/liminal/tests/__pycache__/test_dropdown_compare.cpython-310-pytest-8.3.3.pyc
ADDED
Binary file
|
liminal_orm-2.0.4/liminal/tests/__pycache__/test_entity_schema_compare.cpython-310-pytest-8.3.3.pyc
ADDED
Binary file
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import inspect
|
2
1
|
from datetime import datetime
|
3
2
|
from functools import partial, wraps
|
4
3
|
from typing import TYPE_CHECKING, Any, Callable
|
@@ -102,7 +101,7 @@ class BenchlingValidatorReport(BaseModel):
|
|
102
101
|
|
103
102
|
|
104
103
|
def liminal_validator(
|
105
|
-
func: Callable[[
|
104
|
+
func: Callable[["BenchlingBaseModel"], BenchlingValidatorReport | None]
|
106
105
|
| None = None,
|
107
106
|
*,
|
108
107
|
validator_level: ValidationSeverity = ValidationSeverity.LOW,
|
@@ -125,15 +124,9 @@ def liminal_validator(
|
|
125
124
|
validator_level=validator_level,
|
126
125
|
validator_name=validator_name,
|
127
126
|
)
|
128
|
-
elif not isinstance(
|
129
|
-
func, Callable[[["BenchlingBaseModel"]], BenchlingValidatorReport | None]
|
130
|
-
):
|
131
|
-
raise ValueError(
|
132
|
-
"Parameters passed to liminal_validator must be keyword arguments, not positional arguments."
|
133
|
-
)
|
134
127
|
|
135
128
|
@wraps(func)
|
136
|
-
def wrapper(self:
|
129
|
+
def wrapper(self: "BenchlingBaseModel") -> BenchlingValidatorReport:
|
137
130
|
"""Wrapper that runs the validator function and returns a BenchlingValidatorReport."""
|
138
131
|
try:
|
139
132
|
ret_val = func(self)
|
Binary file
|
Binary file
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "liminal-orm"
|
3
|
-
version = "2.0.
|
3
|
+
version = "2.0.4"
|
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 = ["DynoTx Open Source <opensource@dynotx.com>"]
|
6
6
|
readme = "README.md"
|
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
|
@@ -162,7 +162,7 @@ class ArchiveEntitySchema(BaseOperation):
|
|
162
162
|
|
163
163
|
|
164
164
|
class UnarchiveEntitySchema(BaseOperation):
|
165
|
-
order: ClassVar[int] =
|
165
|
+
order: ClassVar[int] = 110
|
166
166
|
|
167
167
|
def __init__(self, wh_schema_name: str) -> None:
|
168
168
|
self.wh_schema_name = wh_schema_name
|
@@ -187,7 +187,7 @@ class UnarchiveEntitySchema(BaseOperation):
|
|
187
187
|
|
188
188
|
|
189
189
|
class UpdateEntitySchema(BaseOperation):
|
190
|
-
order: ClassVar[int] =
|
190
|
+
order: ClassVar[int] = 100
|
191
191
|
|
192
192
|
def __init__(
|
193
193
|
self,
|
@@ -251,7 +251,7 @@ class UpdateEntitySchema(BaseOperation):
|
|
251
251
|
|
252
252
|
|
253
253
|
class UpdateEntitySchemaNameTemplate(BaseOperation):
|
254
|
-
order: ClassVar[int] =
|
254
|
+
order: ClassVar[int] = 90
|
255
255
|
|
256
256
|
def __init__(
|
257
257
|
self,
|
@@ -283,7 +283,7 @@ class UpdateEntitySchemaNameTemplate(BaseOperation):
|
|
283
283
|
|
284
284
|
|
285
285
|
class CreateEntitySchemaField(BaseOperation):
|
286
|
-
order: ClassVar[int] =
|
286
|
+
order: ClassVar[int] = 120
|
287
287
|
|
288
288
|
def __init__(
|
289
289
|
self,
|
@@ -370,7 +370,7 @@ class CreateEntitySchemaField(BaseOperation):
|
|
370
370
|
|
371
371
|
|
372
372
|
class ArchiveEntitySchemaField(BaseOperation):
|
373
|
-
order: ClassVar[int] =
|
373
|
+
order: ClassVar[int] = 150
|
374
374
|
|
375
375
|
def __init__(
|
376
376
|
self, wh_schema_name: str, wh_field_name: str, index: int | None = None
|
@@ -421,7 +421,7 @@ class ArchiveEntitySchemaField(BaseOperation):
|
|
421
421
|
|
422
422
|
|
423
423
|
class UnarchiveEntitySchemaField(BaseOperation):
|
424
|
-
order: ClassVar[int] =
|
424
|
+
order: ClassVar[int] = 130
|
425
425
|
|
426
426
|
def __init__(
|
427
427
|
self, wh_schema_name: str, wh_field_name: str, index: int | None = None
|
@@ -468,7 +468,7 @@ class UnarchiveEntitySchemaField(BaseOperation):
|
|
468
468
|
|
469
469
|
|
470
470
|
class UpdateEntitySchemaField(BaseOperation):
|
471
|
-
order: ClassVar[int] =
|
471
|
+
order: ClassVar[int] = 140
|
472
472
|
|
473
473
|
def __init__(
|
474
474
|
self,
|
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
|