liminal-orm 1.1.0__py3-none-any.whl → 1.1.1__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.
liminal/orm/column.py CHANGED
@@ -26,12 +26,16 @@ class Column(SqlColumn):
26
26
  Whether the field is a multi-value field.
27
27
  parent_link : bool = False
28
28
  Whether the entity link field is a parent of the entity schema.
29
+ tooltip : str | None = None
30
+ The tooltip text for the field.
29
31
  dropdown : Type[BaseDropdown] | None = None
30
32
  The dropdown for the field.
31
33
  entity_link : str | None = None
32
34
  The warehouse name of the entity the field links to.
33
- tooltip : str | None = None
34
- The tooltip text for the field.
35
+ _warehouse_name : str | None = None
36
+ The warehouse name of the column. Necessary when the variable name is not the same as the warehouse name.
37
+ _archived : bool = False
38
+ Whether the field is archived.
35
39
  """
36
40
 
37
41
  def __init__(
@@ -44,6 +48,7 @@ class Column(SqlColumn):
44
48
  tooltip: str | None = None,
45
49
  dropdown: Type[BaseDropdown] | None = None, # noqa: UP006
46
50
  entity_link: str | None = None,
51
+ _warehouse_name: str | None = None,
47
52
  _archived: bool = False,
48
53
  **kwargs: Any,
49
54
  ):
@@ -82,6 +87,8 @@ class Column(SqlColumn):
82
87
  foreign_key = None
83
88
  if type == BenchlingFieldType.ENTITY_LINK and entity_link:
84
89
  foreign_key = ForeignKey(f"{entity_link}$raw.id")
90
+ if _warehouse_name:
91
+ kwargs["name"] = _warehouse_name
85
92
  super().__init__(
86
93
  self.sqlalchemy_type,
87
94
  foreign_key,
liminal/tests/conftest.py CHANGED
@@ -215,6 +215,24 @@ def mock_benchling_schema(
215
215
  tooltip=None,
216
216
  _archived=False,
217
217
  ),
218
+ "archived_field": Props(
219
+ name="Archived Field",
220
+ type=Type.TEXT,
221
+ required=False,
222
+ is_multi=False,
223
+ _archived=True,
224
+ ),
225
+ "wh_name_field_different": Props(
226
+ name="Different Wh Name Field",
227
+ type=Type.TEXT,
228
+ required=False,
229
+ is_multi=False,
230
+ parent_link=False,
231
+ dropdown_link=None,
232
+ entity_link=None,
233
+ tooltip=None,
234
+ _archived=False,
235
+ ),
218
236
  }
219
237
  return [(schema_props, fields)]
220
238
 
@@ -369,6 +387,20 @@ def mock_benchling_subclass(mock_benchling_dropdown) -> list[type[BaseModel]]:
369
387
  is_multi=True,
370
388
  dropdown=mock_benchling_dropdown,
371
389
  )
390
+ archived_field: SqlColumn = Column(
391
+ name="Archived Field",
392
+ type=Type.TEXT,
393
+ required=False,
394
+ is_multi=False,
395
+ _archived=True,
396
+ )
397
+ different_wh_name_field: SqlColumn = Column(
398
+ name="Different Wh Name Field",
399
+ type=Type.TEXT,
400
+ required=False,
401
+ is_multi=False,
402
+ _warehouse_name="wh_name_field_different",
403
+ )
372
404
 
373
405
  def __init__(
374
406
  self,
@@ -330,3 +330,14 @@ class TestCompareEntitySchemas:
330
330
  assert isinstance(
331
331
  invalid_models["mock_entity"][0].op, ReorderEntitySchemaFields
332
332
  )
333
+
334
+ # Test when the Benchling schema archived field becomes unarchived
335
+ benchling_rearchived_field = copy.deepcopy(mock_benchling_schema)
336
+ benchling_rearchived_field[0][1]["archived_field"].set_archived(False)
337
+ mock_get_benchling_entity_schemas.return_value = benchling_rearchived_field
338
+ invalid_models = compare_entity_schemas(mock_benchling_sdk)
339
+ assert len(invalid_models["mock_entity"]) == 1
340
+ assert isinstance(
341
+ invalid_models["mock_entity"][0].op, ArchiveEntitySchemaField
342
+ )
343
+ assert invalid_models["mock_entity"][0].op.wh_field_name == "archived_field"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liminal-orm
3
- Version: 1.1.0
3
+ Version: 1.1.1
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
@@ -10,6 +10,8 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: Programming Language :: Python :: 3.9
11
11
  Classifier: Programming Language :: Python :: 3.10
12
12
  Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
13
15
  Requires-Dist: benchling-sdk (>=1.8.0)
14
16
  Requires-Dist: bs4 (>=0.0.2,<0.0.3)
15
17
  Requires-Dist: lxml (>=5.3.0,<6.0.0)
@@ -41,21 +41,21 @@ liminal/migrate/revisions_timeline.py,sha256=06qf_7E1Hecucfczpm85rV3ATLDjpCf7y6T
41
41
  liminal/migrate/utils.py,sha256=HdSr3N2WN_1S-PLRGVWSMYl-4gIcP-Ph2wPycGi2cGg,3404
42
42
  liminal/orm/base.py,sha256=fFSpiNRYgK5UG7lbXdQGV8KgO8pwjMqt0pycM3rWJ2o,615
43
43
  liminal/orm/base_model.py,sha256=8p-JnqBJYjLe3bJxgjhTteecRsxCeonljrAfxk4reFM,10963
44
- liminal/orm/column.py,sha256=hYhEiT0n1MwK8xKf6IAQEVfFyy3W8qqzZj_31nnRLe8,4775
44
+ liminal/orm/column.py,sha256=e4JWn97s_4EVJ1LOO5l6iucHQUd39Vl0stqMEj0uet8,5114
45
45
  liminal/orm/mixins.py,sha256=yEeUDF1qEBLP523q8bZra4KtNVK0gwZN9mXJSNe3GEE,4802
46
46
  liminal/orm/relationship.py,sha256=Zl4bMHbtDSPx1psGHYnojGGJpA8B8hwcPJdgjB1lmW0,2490
47
47
  liminal/orm/schema_properties.py,sha256=UEIIayhiwHw7YexSGoKU9Z7gj57d7_C1CMUv51-HcGk,2158
48
48
  liminal/orm/user.py,sha256=elRAHj7HgO3iVLK_pNCIwf_9Rl_9k6vkBgaYazoJSQc,818
49
49
  liminal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  liminal/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
- liminal/tests/conftest.py,sha256=QXVvNZps9gKZ2mYuOBT_NEBvyX2ptdzuPIXj61UG81c,16344
51
+ liminal/tests/conftest.py,sha256=1RGiI_h8izLjT9txJ1IkRHYf8yrN_r6yjUn5SI2bxr8,17311
52
52
  liminal/tests/from benchling_sdk.py,sha256=CjRUHFB3iaa4rUPLGOqDiBq5EPKldm-Fd8aQQr92zF4,147
53
53
  liminal/tests/test_dropdown_compare.py,sha256=yHB0ovQlBLRu8-qYkqIPd8VtYEOmOft_93FQM86g_z8,8198
54
- liminal/tests/test_entity_schema_compare.py,sha256=mnHD3mBJ-lW_MCwbqRNSBkrBfxztNF74bSvTRnpRcis,15768
54
+ liminal/tests/test_entity_schema_compare.py,sha256=p-9inAZM4GOm4e1cadO191LNsnqceUGGyy0YVIXXxVw,16440
55
55
  liminal/utils.py,sha256=vMjSasDnEghwqULDo14joxxJ56G4-9cBsw719nQ8C7g,2798
56
56
  liminal/validation/__init__.py,sha256=SBd48xxBMJrBzI48G2RcK056EMlevt5YjmZMkfCWN1I,6924
57
- liminal_orm-1.1.0.dist-info/LICENSE.md,sha256=oVA877F_D1AV44dpjsv4f-4k690uNGApX1EtzOo3T8U,11353
58
- liminal_orm-1.1.0.dist-info/METADATA,sha256=xRc0SSZkYct2RcE7uQlKSKkss-LxA2KFr4eH1RkJXXM,11211
59
- liminal_orm-1.1.0.dist-info/WHEEL,sha256=kLuE8m1WYU0Ig0_YEGrXyTtiJvKPpLpDEiChiNyei5Y,88
60
- liminal_orm-1.1.0.dist-info/entry_points.txt,sha256=atIrU63rrzH81dWC2sjUbFLlc5FWMmYRdMxXEWexIZA,47
61
- liminal_orm-1.1.0.dist-info/RECORD,,
57
+ liminal_orm-1.1.1.dist-info/LICENSE.md,sha256=oVA877F_D1AV44dpjsv4f-4k690uNGApX1EtzOo3T8U,11353
58
+ liminal_orm-1.1.1.dist-info/METADATA,sha256=-GObmj3sShq8Isn7h2M-6BT-ssmbsSc3UFebxvWEkRE,11313
59
+ liminal_orm-1.1.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
+ liminal_orm-1.1.1.dist-info/entry_points.txt,sha256=atIrU63rrzH81dWC2sjUbFLlc5FWMmYRdMxXEWexIZA,47
61
+ liminal_orm-1.1.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.5.1
2
+ Generator: poetry-core 1.9.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any