Skip to content

Commit

Permalink
Fixed error message for entity in filter spec and where clause
Browse files Browse the repository at this point in the history
Fixed error message for entity in where parameter and filter spec. The error message before this change would be oddly nested & duplicative. (Main version)
  • Loading branch information
DevonFulcher authored Oct 6, 2023
1 parent b306a5b commit f3ab01e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20231006-100304.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: Fix error message for entity in filter spec and where parameter
time: 2023-10-06T10:03:04.514682-05:00
custom:
Author: DevonFulcher
Issue: None
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ def create_entity(entity_name: str, entity_path: Sequence[str] = ()) -> EntityCa
"""Gets called by Jinja when rendering {{ Entity(...) }}."""
group_by_item_name = DunderedNameFormatter.parse_name(entity_name)
if len(group_by_item_name.entity_links) > 0 or group_by_item_name.time_granularity is not None:
ParameterSetFactory._exception_message_for_incorrect_format(
f"Name is in an incorrect format: {entity_name} "
f"When referencing entities, the name should not have any dunders (double underscores, or __)."
)
ParameterSetFactory._exception_message_for_incorrect_format(entity_name)

return EntityCallParameterSet(
entity_path=tuple(EntityReference(element_name=arg) for arg in entity_path),
Expand Down

0 comments on commit f3ab01e

Please sign in to comment.