Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion liminal/enums/benchling_field_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def get_non_multi_select_types(cls) -> list[str]:

@classmethod
def get_entity_link_types(cls) -> list[str]:
return [cls.ENTITY_LINK, cls.TRANSLATION_LINK]
return [cls.ENTITY_LINK, cls.TRANSLATION_LINK, cls.PART_LINK]
12 changes: 3 additions & 9 deletions liminal/mappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,10 @@ def convert_field_type_to_api_field_type(
BenchlingAPIFieldType.FILE_LINK,
BenchlingFolderItemType.SEQUENCE,
),
BenchlingFieldType.PART_LINK: (
BenchlingAPIFieldType.PART_LINK,
BenchlingFolderItemType.SEQUENCE,
),
BenchlingFieldType.PART_LINK: (BenchlingAPIFieldType.PART_LINK, None),
BenchlingFieldType.TRANSLATION_LINK: (
BenchlingAPIFieldType.TRANSLATION_LINK,
BenchlingFolderItemType.SEQUENCE,
None,
),
BenchlingFieldType.ENTITY_LINK: (BenchlingAPIFieldType.FILE_LINK, None),
BenchlingFieldType.DECIMAL: (BenchlingAPIFieldType.FLOAT, None),
Expand Down Expand Up @@ -138,10 +135,7 @@ def convert_api_field_type_to_field_type(
BenchlingAPIFieldType.FILE_LINK,
BenchlingFolderItemType.PROTEIN,
): BenchlingFieldType.AA_SEQUENCE_LINK,
(
BenchlingAPIFieldType.PART_LINK,
BenchlingFolderItemType.SEQUENCE,
): BenchlingFieldType.PART_LINK,
(BenchlingAPIFieldType.PART_LINK, None): BenchlingFieldType.PART_LINK,
(
BenchlingAPIFieldType.TRANSLATION_LINK,
None,
Expand Down
4 changes: 2 additions & 2 deletions liminal/orm/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def __init__(
raise ValueError("Dropdown must be set if the field type is DROPDOWN.")
if entity_link and type not in BenchlingFieldType.get_entity_link_types():
raise ValueError(
"Entity link can only be set if the field type is ENTITY_LINK or TRANSLATION_LINK."
f"Entity link can only be set if the field type is one of {BenchlingFieldType.get_entity_link_types()}."
)
if parent_link and type not in BenchlingFieldType.get_entity_link_types():
raise ValueError(
"Parent link can only be set if the field type is ENTITY_LINK or TRANSLATION_LINK."
f"Parent link can only be set if the field type is one of {BenchlingFieldType.get_entity_link_types()}."
)
if type in BenchlingFieldType.get_non_multi_select_types() and is_multi is True:
raise ValueError(f"Field type {type} cannot have multi-value set as True.")
Expand Down