Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ def notify(self, entities: DuckDBEntities, *, config: Notification) -> Messages:
messages.append(
FeedbackMessage(
entity=config.reporting.reporting_entity_override or config.entity_name,
original_entity=config.entity_name,
record=record, # type: ignore
error_location=config.reporting.legacy_location,
error_message=template_object(config.reporting.message, record), # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def notify(self, entities: SparkEntities, *, config: Notification) -> Messages:
# more complex extraction done in reporting module
FeedbackMessage(
entity=config.reporting.reporting_entity_override or config.entity_name,
original_entity=config.entity_name,
record=record.asDict(recursive=True),
error_location=config.reporting.legacy_location,
error_message=template_object(
Expand Down
2 changes: 2 additions & 0 deletions src/dve/core_engine/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class FeedbackMessage: # pylint: disable=too-many-instance-attributes
still be completed (i.e. filters and joins can still be applied).

"""
original_entity: Optional[EntityName] = None
"""The original entity before any modifications to the name (if applicable)."""
is_informational: bool = False
"""Whether the message is simply for information or has affected the outputs."""
error_type: Optional[str] = None
Expand Down
8 changes: 7 additions & 1 deletion src/dve/reporting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ def dump_feedback_errors(
processed = []

for message in messages:
primary_keys: list[str] = key_fields.get(message.entity if message.entity else "", [])
if message.original_entity is not None:
primary_keys = key_fields.get(message.original_entity, [])
elif message.entity is not None:
primary_keys = key_fields.get(message.entity, [])
else:
primary_keys = []

error = message.to_dict(
key_field=primary_keys,
value_separator=" -- ",
Expand Down