liminal-orm 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl

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.
@@ -30,6 +30,8 @@ class BenchlingConnection(BaseModel):
30
30
  warehouse_access: bool = False
31
31
  Whether your Benchling tenant has access to the warehouse. If warehouse_connection_string is provided, this will default to True.
32
32
  warehouse_access is required to set a custom warehouse names on entity schemas and their fields.
33
+ fieldsets: bool = False
34
+ Whether your Benchling tenant has access to fieldsets.
33
35
  """
34
36
 
35
37
  tenant_name: str
@@ -41,6 +43,7 @@ class BenchlingConnection(BaseModel):
41
43
  internal_api_admin_email: str | None = None
42
44
  internal_api_admin_password: str | None = None
43
45
  warehouse_access: bool = False
46
+ fieldsets: bool = False
44
47
 
45
48
  @model_validator(mode="before")
46
49
  @classmethod
@@ -96,9 +96,11 @@ class CreateEntitySchema(BaseOperation):
96
96
  raise ValueError(
97
97
  f"Entity schema warehouse name {self._validated_schema_properties.warehouse_name} already exists in Benchling."
98
98
  )
99
- if self._validated_schema_properties.prefix in [
100
- schema["prefix"] for schema in all_schemas
101
- ]:
99
+ if (
100
+ not benchling_service.connection.fieldsets
101
+ and self._validated_schema_properties.prefix
102
+ in [schema["prefix"] for schema in all_schemas]
103
+ ):
102
104
  raise ValueError(
103
105
  f"Entity schema prefix {self._validated_schema_properties.prefix} already exists in Benchling."
104
106
  )
@@ -235,9 +237,11 @@ class UpdateEntitySchema(BaseOperation):
235
237
  raise ValueError(
236
238
  f"Entity schema warehouse name {self.update_props.warehouse_name} already exists in Benchling."
237
239
  )
238
- if self.update_props.prefix and self.update_props.prefix in [
239
- schema["prefix"] for schema in all_schemas
240
- ]:
240
+ if (
241
+ not benchling_service.connection.fieldsets
242
+ and self.update_props.prefix
243
+ and self.update_props.prefix in [schema["prefix"] for schema in all_schemas]
244
+ ):
241
245
  raise ValueError(
242
246
  f"Entity schema prefix {self.update_props.prefix} already exists in Benchling."
243
247
  )
liminal/orm/base_model.py CHANGED
@@ -12,8 +12,8 @@ from sqlalchemy.orm.decl_api import declared_attr
12
12
 
13
13
  from liminal.base.base_validation_filters import BaseValidatorFilters
14
14
  from liminal.orm.base import Base
15
+ from liminal.orm.base_tables.user import User
15
16
  from liminal.orm.schema_properties import SchemaProperties
16
- from liminal.orm.user import User
17
17
  from liminal.validation import (
18
18
  BenchlingValidator,
19
19
  BenchlingValidatorReport,
@@ -0,0 +1,60 @@
1
+ from datetime import datetime
2
+
3
+ from sqlalchemy import Column, ForeignKey
4
+ from sqlalchemy.types import DATETIME, Boolean, String
5
+
6
+ from liminal.orm.base import Base
7
+ from liminal.orm.relationship import single_relationship
8
+
9
+
10
+ class RegistryEntity(Base):
11
+ __tablename__ = "registry_entity$raw"
12
+
13
+ id = Column("id", String, nullable=True, primary_key=True)
14
+ archived = Column("archived$", Boolean, nullable=True)
15
+ archive_purpose = Column("archive_purpose$", String, nullable=True)
16
+ created_at = Column("created_at", DATETIME, nullable=True)
17
+ creator_id = Column("creator_id", String, ForeignKey("user$raw.id"), nullable=True)
18
+ file_registry_id = Column("file_registry_id", String, nullable=True)
19
+ folder_id = Column("folder_id", String, nullable=True)
20
+ modified_at = Column("modified_at", DATETIME, nullable=True)
21
+ name = Column("name", String, nullable=True)
22
+ project_id = Column("project_id", String, nullable=True)
23
+ schema_id = Column("schema_id", String, nullable=True)
24
+ source_id = Column("source_id", String, nullable=True)
25
+ url = Column("url", String, nullable=True)
26
+ validation_status = Column("validation_status", String, nullable=True)
27
+
28
+ creator = single_relationship("User", creator_id)
29
+
30
+ def __init__(
31
+ self,
32
+ id: str,
33
+ archived: bool,
34
+ archive_purpose: str,
35
+ created_at: datetime,
36
+ file_registry_id: str,
37
+ folder_id: str,
38
+ modified_at: datetime,
39
+ name: str,
40
+ project_id: str,
41
+ schema: str,
42
+ schema_id: str,
43
+ source_id: str,
44
+ url: str,
45
+ validation_status: str,
46
+ ):
47
+ self.id = id
48
+ self.archived = archived
49
+ self.archive_purpose = archive_purpose
50
+ self.created_at = created_at
51
+ self.file_registry_id = file_registry_id
52
+ self.folder_id = folder_id
53
+ self.modified_at = modified_at
54
+ self.name = name
55
+ self.project_id = project_id
56
+ self.schema = schema
57
+ self.schema_id = schema_id
58
+ self.source_id = source_id
59
+ self.url = url
60
+ self.validation_status = validation_status
@@ -0,0 +1,31 @@
1
+ from sqlalchemy import Column
2
+ from sqlalchemy.types import Boolean, String
3
+
4
+ from liminal.orm.base import Base
5
+
6
+
7
+ class Schema(Base):
8
+ __tablename__ = "schema$raw"
9
+
10
+ id = Column("id", String, nullable=True, primary_key=True)
11
+ schema_type = Column("schema_type", String, nullable=True)
12
+ name = Column("name", String, nullable=True)
13
+ system_name = Column("system_name", String, nullable=True)
14
+ archived = Column("archived$", Boolean, nullable=True)
15
+ archive_purpose = Column("archive_purpose$", String, nullable=True)
16
+
17
+ def __init__(
18
+ self,
19
+ id: str,
20
+ schema_type: str,
21
+ name: str,
22
+ system_name: str,
23
+ archived: bool,
24
+ archive_purpose: str,
25
+ ):
26
+ self.id = id
27
+ self.schema_type = schema_type
28
+ self.name = name
29
+ self.system_name = system_name
30
+ self.archived = archived
31
+ self.archive_purpose = archive_purpose
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liminal-orm
3
- Version: 1.1.2
3
+ Version: 1.1.3
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
@@ -11,7 +11,7 @@ liminal/cli/controller.py,sha256=QNj3QO9TMb9hfc6U-VhLuFa0_aohOHZUmvY4XkATPhw,101
11
11
  liminal/cli/live_test_dropdown_migration.py,sha256=87JwxGD4A5ExjfsEEev9jgBNuldUj4CLoaFwsZ-BjEI,2889
12
12
  liminal/cli/live_test_entity_schema_migration.py,sha256=_JawaiJNHkAjIrtwe9_K15OoJSFq_4vaTK5vrmz-b6s,5576
13
13
  liminal/connection/__init__.py,sha256=3z4pSANIOkc9mh1Xp763oYQuJZDEh4lauN901PU4vqI,166
14
- liminal/connection/benchling_connection.py,sha256=a69pIwQX7t0wd6GnI1IwUG3VnNOb4u6vcBINs_V1o-Y,2743
14
+ liminal/connection/benchling_connection.py,sha256=nALLAA-hPIO2Eb_KhUL-nU3jOlMDSIrPMUgUyDKGRRw,2862
15
15
  liminal/connection/benchling_service.py,sha256=lEYCHF1U8nII8Rn3rMBPTffTFiVFjoFeNmX2Kq36-qE,7170
16
16
  liminal/dropdowns/api.py,sha256=n5oxi1EhkmpmPpNi1LOI4xcIQmk1C069XFaGP5XSBx8,6959
17
17
  liminal/dropdowns/compare.py,sha256=5cz8djtaStozUun_Cp8t_5PVjq-aovme2Qq5J8FXFg4,6829
@@ -22,7 +22,7 @@ liminal/entity_schemas/api.py,sha256=Dkd44NGJ4JqRTJLJtPsZ8Qan2owbEYf446A6EuP8iL0
22
22
  liminal/entity_schemas/compare.py,sha256=C5qr9amGCKvkV61pa29obN883vSdFzSoiebD7hKEHY4,14128
23
23
  liminal/entity_schemas/entity_schema_models.py,sha256=SNScXY3SeF0lhdAXwqKXrrgpCphpLg6s5tU9fO3juB4,5239
24
24
  liminal/entity_schemas/generate_files.py,sha256=SW0EccfODptNkZUVwJxa8-8ssd1RWdBqzrCGph4_vSI,8515
25
- liminal/entity_schemas/operations.py,sha256=C5Qg7IQVwFqjmk6egIZkV4HaJUmygWRFhLIDqwjOnYQ,23018
25
+ liminal/entity_schemas/operations.py,sha256=E12U-F0PtViBApbkoXbEtOlIEcOSSYn_gBx-2Z-vGGM,23164
26
26
  liminal/entity_schemas/tag_schema_models.py,sha256=rRCAvpjx7iAiIxOh9MRBrpH603zHbFxKOY7sLgOutnE,16260
27
27
  liminal/entity_schemas/utils.py,sha256=X53KNfguWtu7z-tAliBHuCYpSwTqBGgRSGsdR_BU9Vc,4206
28
28
  liminal/enums/__init__.py,sha256=jz_c-B_fifatvrYoESlHZ9ljYdz-3rNl0sBazoESiHI,523
@@ -40,12 +40,14 @@ liminal/migrate/revision.py,sha256=KppU0u-d0JsfPsXsmncxy9Q_XBJyf-o4e16wNZAJODM,7
40
40
  liminal/migrate/revisions_timeline.py,sha256=06qf_7E1Hecucfczpm85rV3ATLDjpCf7y6TUfah5aLM,14450
41
41
  liminal/migrate/utils.py,sha256=HdSr3N2WN_1S-PLRGVWSMYl-4gIcP-Ph2wPycGi2cGg,3404
42
42
  liminal/orm/base.py,sha256=fFSpiNRYgK5UG7lbXdQGV8KgO8pwjMqt0pycM3rWJ2o,615
43
- liminal/orm/base_model.py,sha256=8p-JnqBJYjLe3bJxgjhTteecRsxCeonljrAfxk4reFM,10963
43
+ liminal/orm/base_model.py,sha256=V6hX2q6n_5xWJaOdYUNOpw3dHcypy_wyloGxkl9_TDs,10975
44
+ liminal/orm/base_tables/registry_entity.py,sha256=4ET1cepTGjZ3AMFI5q-iMYxMObzXwuUDBD0jNNqCipE,2126
45
+ liminal/orm/base_tables/schema.py,sha256=7_btCVSUJxjVdGcKVRKL8sKcNw7-_gazTpfEh1jru3o,921
46
+ liminal/orm/base_tables/user.py,sha256=elRAHj7HgO3iVLK_pNCIwf_9Rl_9k6vkBgaYazoJSQc,818
44
47
  liminal/orm/column.py,sha256=e4JWn97s_4EVJ1LOO5l6iucHQUd39Vl0stqMEj0uet8,5114
45
48
  liminal/orm/mixins.py,sha256=yEeUDF1qEBLP523q8bZra4KtNVK0gwZN9mXJSNe3GEE,4802
46
49
  liminal/orm/relationship.py,sha256=Zl4bMHbtDSPx1psGHYnojGGJpA8B8hwcPJdgjB1lmW0,2490
47
50
  liminal/orm/schema_properties.py,sha256=UEIIayhiwHw7YexSGoKU9Z7gj57d7_C1CMUv51-HcGk,2158
48
- liminal/orm/user.py,sha256=elRAHj7HgO3iVLK_pNCIwf_9Rl_9k6vkBgaYazoJSQc,818
49
51
  liminal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
52
  liminal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
53
  liminal/tests/conftest.py,sha256=1RGiI_h8izLjT9txJ1IkRHYf8yrN_r6yjUn5SI2bxr8,17311
@@ -54,8 +56,8 @@ liminal/tests/test_dropdown_compare.py,sha256=yHB0ovQlBLRu8-qYkqIPd8VtYEOmOft_93
54
56
  liminal/tests/test_entity_schema_compare.py,sha256=p-9inAZM4GOm4e1cadO191LNsnqceUGGyy0YVIXXxVw,16440
55
57
  liminal/utils.py,sha256=vMjSasDnEghwqULDo14joxxJ56G4-9cBsw719nQ8C7g,2798
56
58
  liminal/validation/__init__.py,sha256=SBd48xxBMJrBzI48G2RcK056EMlevt5YjmZMkfCWN1I,6924
57
- liminal_orm-1.1.2.dist-info/LICENSE.md,sha256=oVA877F_D1AV44dpjsv4f-4k690uNGApX1EtzOo3T8U,11353
58
- liminal_orm-1.1.2.dist-info/METADATA,sha256=UM5xJJCO9Hy5N8_uxpTqqxgEnxr0bWmKi8LB6R_pLik,11313
59
- liminal_orm-1.1.2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
- liminal_orm-1.1.2.dist-info/entry_points.txt,sha256=atIrU63rrzH81dWC2sjUbFLlc5FWMmYRdMxXEWexIZA,47
61
- liminal_orm-1.1.2.dist-info/RECORD,,
59
+ liminal_orm-1.1.3.dist-info/LICENSE.md,sha256=oVA877F_D1AV44dpjsv4f-4k690uNGApX1EtzOo3T8U,11353
60
+ liminal_orm-1.1.3.dist-info/METADATA,sha256=B5aAUjYgRCbXTlzlpoQJSGln5Q8rJAYUOGO5Q5MMl7o,11313
61
+ liminal_orm-1.1.3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
62
+ liminal_orm-1.1.3.dist-info/entry_points.txt,sha256=atIrU63rrzH81dWC2sjUbFLlc5FWMmYRdMxXEWexIZA,47
63
+ liminal_orm-1.1.3.dist-info/RECORD,,
File without changes