Skip to content

Commit 568a41c

Browse files
Bugfix/gr ndit 1018 fix issue with id becoming blank (#71)
* fix: enable passing of original_entity_override to fix instance where id cannot be sourced from current entity * bump: version 0.7.0 → 0.7.1
1 parent aed9cd0 commit 568a41c

6 files changed

Lines changed: 18 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.7.1 (2026-03-12)
2+
3+
### Fix
4+
5+
- enable passing of original_entity_override to fix instance where id cannot be sourced from current entity
6+
17
## v0.7.0 (2026-03-12)
28

39
### Feat

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "data-validation-engine"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "`nhs data validation engine` is a framework used to validate data"
55
authors = ["NHS England <england.contactus@nhs.net>"]
66
readme = "README.md"

src/dve/core_engine/backends/implementations/duckdb/rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ def notify(self, entities: DuckDBEntities, *, config: Notification) -> Messages:
505505
messages.append(
506506
FeedbackMessage(
507507
entity=config.reporting.reporting_entity_override or config.entity_name,
508-
original_entity=config.entity_name,
508+
original_entity=config.reporting.original_entity_override or config.entity_name,
509509
record=record, # type: ignore
510510
error_location=config.reporting.legacy_location,
511511
error_message=template_object(config.reporting.message, record), # type: ignore

src/dve/core_engine/backends/implementations/spark/rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def notify(self, entities: SparkEntities, *, config: Notification) -> Messages:
401401
# more complex extraction done in reporting module
402402
FeedbackMessage(
403403
entity=config.reporting.reporting_entity_override or config.entity_name,
404-
original_entity=config.entity_name,
404+
original_entity=config.reporting.original_entity_override or config.entity_name,
405405
record=record.asDict(recursive=True),
406406
error_location=config.reporting.legacy_location,
407407
error_message=template_object(

src/dve/core_engine/backends/metadata/reporting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
from dve.core_engine.templating import template_object
1212
from dve.core_engine.type_hints import (
13+
EntityName,
1314
ErrorCategory,
1415
ErrorCode,
1516
ErrorEmitValue,
@@ -102,6 +103,12 @@ class BaseReportingConfig(BaseModel):
102103
If this is not provided, the top level names from the `location` field
103104
will be used in the report.
104105
106+
"""
107+
original_entity_override: Optional[EntityName] = None
108+
"""
109+
This should only be populated where you need to refer back to an originally defined entity that
110+
contains the key field(s) of interest. This might be required in cases where you've created
111+
lots of new entities during a complex rule.
105112
"""
106113

107114
def template(

src/dve/core_engine/configuration/v1/filters.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConcreteFilterConfig(BaseModel):
2424
reporting_field: Optional[Union[str, list[str]]] = None
2525
reporting_field_name: Optional[str] = None
2626
category: ErrorCategory = "Bad value"
27+
original_entity_override: Optional[str] = None
2728

2829
def to_step(self) -> AbstractStep:
2930
"""Create a deferred filter from the concrete filter config."""
@@ -37,6 +38,7 @@ def to_step(self) -> AbstractStep:
3738
legacy_is_informational=self.is_informational,
3839
legacy_location=self.error_location,
3940
legacy_reporting_field=self.reporting_field,
41+
original_entity_override=self.original_entity_override,
4042
)
4143

4244
return DeferredFilter(

0 commit comments

Comments
 (0)