liminal-orm 1.1.0__tar.gz → 1.1.2__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.
Files changed (60) hide show
  1. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/PKG-INFO +3 -1
  2. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/generate_files.py +0 -1
  3. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/operations.py +1 -1
  4. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/column.py +9 -2
  5. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/tests/conftest.py +32 -0
  6. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/tests/test_entity_schema_compare.py +11 -0
  7. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/pyproject.toml +1 -1
  8. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/LICENSE.md +0 -0
  9. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/README.md +0 -0
  10. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/__init__.py +0 -0
  11. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/base_dropdown.py +0 -0
  12. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/base_operation.py +0 -0
  13. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/base_validation_filters.py +0 -0
  14. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/compare_operation.py +0 -0
  15. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/properties/base_field_properties.py +0 -0
  16. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/properties/base_schema_properties.py +0 -0
  17. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/base/str_enum.py +0 -0
  18. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/cli/cli.py +0 -0
  19. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/cli/controller.py +0 -0
  20. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/cli/live_test_dropdown_migration.py +0 -0
  21. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/cli/live_test_entity_schema_migration.py +0 -0
  22. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/connection/__init__.py +0 -0
  23. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/connection/benchling_connection.py +0 -0
  24. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/connection/benchling_service.py +0 -0
  25. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/dropdowns/api.py +0 -0
  26. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/dropdowns/compare.py +0 -0
  27. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/dropdowns/generate_files.py +0 -0
  28. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/dropdowns/operations.py +0 -0
  29. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/dropdowns/utils.py +0 -0
  30. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/api.py +0 -0
  31. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/compare.py +0 -0
  32. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/entity_schema_models.py +0 -0
  33. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/tag_schema_models.py +0 -0
  34. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/entity_schemas/utils.py +0 -0
  35. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/__init__.py +0 -0
  36. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_api_field_type.py +0 -0
  37. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_entity_type.py +0 -0
  38. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_field_type.py +0 -0
  39. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_folder_item_type.py +0 -0
  40. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_naming_strategy.py +0 -0
  41. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_report_level.py +0 -0
  42. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/enums/benchling_sequence_type.py +0 -0
  43. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/external/__init__.py +0 -0
  44. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/mappers.py +0 -0
  45. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/migrate/components.py +0 -0
  46. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/migrate/revision.py +0 -0
  47. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/migrate/revisions_timeline.py +0 -0
  48. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/migrate/utils.py +0 -0
  49. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/base.py +0 -0
  50. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/base_model.py +0 -0
  51. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/mixins.py +0 -0
  52. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/relationship.py +0 -0
  53. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/schema_properties.py +0 -0
  54. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/orm/user.py +0 -0
  55. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/py.typed +0 -0
  56. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/tests/__init__.py +0 -0
  57. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/tests/from benchling_sdk.py +0 -0
  58. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/tests/test_dropdown_compare.py +0 -0
  59. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/utils.py +0 -0
  60. {liminal_orm-1.1.0 → liminal_orm-1.1.2}/liminal/validation/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: liminal-orm
3
- Version: 1.1.0
3
+ Version: 1.1.2
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)
@@ -74,7 +74,6 @@ def generate_all_entity_schema_files(
74
74
  columns = {key: columns[key] for key in columns}
75
75
  import_strings = [
76
76
  "from sqlalchemy import Column as SqlColumn",
77
- "from sqlalchemy.orm import Query, Session",
78
77
  "from liminal.orm.column import Column",
79
78
  "from liminal.orm.base_model import BaseModel",
80
79
  "from liminal.orm.schema_properties import SchemaProperties",
@@ -439,7 +439,7 @@ class UnarchiveEntitySchemaField(BaseOperation):
439
439
 
440
440
 
441
441
  class UpdateEntitySchemaField(BaseOperation):
442
- order: ClassVar[int] = 14
442
+ order: ClassVar[int] = 140
443
443
 
444
444
  def __init__(
445
445
  self,
@@ -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,
@@ -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
  [tool.poetry]
2
2
  name = "liminal-orm"
3
- version = "1.1.0"
3
+ version = "1.1.2"
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