Skip to content

Commit c896f98

Browse files
authored
Merge pull request #108 from NHSDigital/release_v09
Release v09
2 parents 040d288 + 24c2f48 commit c896f98

118 files changed

Lines changed: 2526 additions & 955 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[tools]
22
python="3.12"
3-
poetry="2.3.3"
3+
poetry="2.4.1"
44
java="liberica-1.8.0"

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
1+
## v0.9.0 (2026-08-12)
2+
3+
### Fix
4+
5+
- alphanumeric and identifier type (#136)
6+
7+
## v0.9.0rc0 (2026-07-16)
8+
9+
### Fix
10+
11+
- inherit is_mandatory with get_type_and_validators
12+
- adjusted the `is_type_complex` function to work with subclasses of 'simple' types
13+
14+
### Refactor
15+
16+
- upgrade pydantic to v2 (#107)
17+
118
## v0.8.4 (2026-08-11)
219

20+
### Fix
21+
22+
- ensure that format for times can be accessed and supplied in duckdb casting (#135)
23+
24+
### Build
25+
26+
- bump cryptography from 48.0.1 to 50.0.0 (#133)
27+
- bump pymdown-extensions from 10.21.3 to 11.0.1 (#134)
28+
29+
330
## v0.8.3 (2026-07-14)
431

532
### Fix

CONTRIBUTE.md renamed to CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ poetry install --with lint
5858

5959
## Installation for Development
6060

61-
We are utilising Poetry for build dependency management and packaging. If you're on a system that has `Make` available, you can simply run `make install` to setup a local virtual environment with all the dependencies installed (this won't install Poetry for you).
61+
We are utilising Poetry for build dependency management and packaging. To install simply run `poetry install`. If you need to update any of the dependencies then you will need to run `poetry lock` before the install command. **Please always review the contents of the lock before installing. We have a `min-release-age` of `10` which means that packages will not be updated until they have been released for at least 10 days.
6262

6363
## Testing
6464

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
activate = poetry run
22

3-
# dev
4-
install:
5-
poetry lock
6-
poetry install --with dev
7-
83
# dist
94
wheel:
105
poetry build -f wheel

README.md

Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 style="display: flex; align-items: center; gap: 10px;">
2-
<img src="https://github.com/NHSDigital/data-validation-engine/blob/616b55890306db4546177f7effac48ca241857ec/overrides/.icons/nhseng.svg" alt="" width="5%" height="100%" align="left">
2+
<img src="https://raw.githubusercontent.com/NHSDigital/data-validation-engine/616b55890306db4546177f7effac48ca241857ec/overrides/.icons/nhseng.svg" alt="" width="5%" height="100%" align="left">
33
Data Validation Engine
44
</h1>
55

@@ -9,49 +9,27 @@
99
[![CI Unit Tests](https://github.com/NHSDigital/data-validation-engine/actions/workflows/ci_testing.yml/badge.svg)](https://github.com/NHSDigital/data-validation-engine/actions/workflows/ci_testing.yml)
1010
[![CI Formatting & Linting](https://github.com/NHSDigital/data-validation-engine/actions/workflows/ci_linting.yml/badge.svg)](https://github.com/NHSDigital/data-validation-engine/actions/workflows/ci_linting.yml)
1111

12-
The Data Validation Engine (DVE) is a configuration driven data validation library built and utilised by NHS England. Currently the package has been reverted from v1.0.0 release to a 0.x as we feel the package is not yet mature enough to be considered a 1.0.0 release. So please bear this in mind if reading through the commits and references to a v1+ release when on v0.x.
12+
The Data Validation Engine (DVE) is a configuration-driven data validation library created and used by NHS England. It lets users define validation rules once and apply them across multiple dataset collections - supporting consistent, accurate data checks.
1313

14-
As mentioned above, the DVE is "configuration driven" which means the majority of development for you as a user will be building a JSON document to describe how the data will be validated. The JSON document is known as a `dischema` file and example files can be accessed [here](https://github.com/NHSDigital/data-validation-engine/tree/main/tests/testdata). If you'd like to learn more about JSON document and how to build one from scratch, then please read the documentation [here](https://nhsdigital.github.io/data-validation-engine/).
14+
__The DVE offers__:
1515

16-
Once a dischema file has been defined, you are ready to use the DVE. The DVE is typically orchestrated based on four key "services". These are...
16+
- SQL configuration-based validations
17+
- Format normalization to Parquet for a unified data representation
18+
- Data modelling and typecasting
19+
- Business-rule validations executed on supported backends such as Spark and DuckDB, with the option to add custom backends
20+
- Deriving new fields and entities
21+
- Clear validation reporting, including summary insights and record-level error messages
1722

18-
| | Service | Purpose |
19-
| -- | ------- | ------- |
20-
| 1. | File Transformation | This service will take submitted files and turn them into stringified parquet file(s) to ensure that a consistent data structure can be passed through the other services. |
21-
| 2. | Data Contract | This service will validate and perform type casting against a stringified parquet file using [pydantic models](https://docs.pydantic.dev/1.10/). |
22-
| 3. | Business Rules | The business rules service will perform more complex validations such as comparisons between fields and tables, aggregations, filters etc to generate new entities. |
23-
| 4. | Error Reports | The error reports service will take all the errors raised in previous services and surface them into a readable format for a downstream users/service. Currently, this implemented to be an excel spreadsheet but could be reconfigured to meet other requirements/use cases. |
24-
25-
If you'd like more detailed documentation around these services the please read the extended documentation [here](https://nhsdigital.github.io/data-validation-engine/).
26-
27-
The DVE has been designed in a way that's modular and can support users who just want to utilise specific "services" from the DVE (i.e. just the file transformation + data contract). Additionally, the DVE is designed to support different backend implementations. As part of the base installation of DVE, you will find backend support for `Spark` and `DuckDB`. So, if you need a `MySQL` backend implementation, you can implement this yourself. Given our organisations requirements, it will be unlikely that we add anymore specific backend implementations into the base package beyond Spark and DuckDB. So, if you are unable to implement this yourself, I would recommend reading the guidance on [requesting new features and raising bug reports here](#requesting-new-features-and-raising-bug-reports).
28-
29-
Additionally, if you'd like to contribute a new backend implementation into the base DVE package, then please look at the [Contributing](#Contributing) section.
23+
As mentioned above, the DVE is "configuration driven" which means the majority of development for you as a user will be building a JSON document to describe how the data will be validated. The JSON document is known as a `dischema` (data ingest schema) file and example files can be accessed [here ↗️](https://github.com/NHSDigital/data-validation-engine/tree/main/tests/testdata). If you'd like to learn more about JSON document and how to build one from scratch, then please read the documentation [here ↗️](https://nhsdigital.github.io/data-validation-engine/).
3024

3125
## Installation and usage
3226

33-
The DVE is a Python package and can be installed using package managers such as [pip](https://pypi.org/project/pip/). As of the latest release we support Python 3.10 & 3.11, with Spark v3.4 and DuckDB v1.1. In the future we will be looking to upgrade the DVE to working on a higher versions of Python, DuckDB and Spark.
34-
35-
If you're planning to use the Spark backend implementation, you will also need OpenJDK 11 installed.
36-
37-
Python dependencies are listed in `pyproject.toml`.
38-
39-
To install the DVE package you can simply install using a package manager such as [pip](https://pypi.org/project/pip/).
40-
41-
```
42-
pip install data-validation-engine
43-
```
44-
45-
*Note - Only versions >=0.6.2 are available on PyPi. For older versions please install directly from the git repo or build from source.*
46-
47-
Once you have installed the DVE you are ready to use it. For guidance on how to create your dischema JSON document (configuration), please read the [documentation](https://nhsdigital.github.io/data-validation-engine/).
48-
49-
Version 0.0.1 does support a working Python 3.7 installation. However, we will not be supporting any issues with that version of the DVE if you choose to use it. __Use at your own risk__.
27+
Please see the documentation [here ↗️](https://nhsdigital.github.io/data-validation-engine/user_guidance/install/).
5028

5129
## Requesting new features and raising bug reports
5230
**Before creating new issues, please check to see if the same bug/feature has been created already. Where a duplicate is created, the ticket will be closed and referenced to an existing issue.**
5331

54-
If you have spotted a bug with the DVE then please raise an issue [here](https://github.com/nhsengland/Data-Validation-Engine/issues) using the "bug template".
32+
If you have spotted a bug with the DVE then please raise an issue [here ↗️](https://github.com/nhsengland/Data-Validation-Engine/issues) using the "bug template".
5533

5634
If you have feature request then please follow the same process whilst using the "Feature request template".
5735

@@ -63,7 +41,7 @@ Below is a list of features that we would like to implement or have been request
6341
| Uplift to Python 3.11 | 0.2.0 | Yes |
6442
| Uplift Pyspark to 3.5 | 0.8.0 | Yes |
6543
| Allow DVE to run on Python 3.12+ | 0.8.0 | Yes |
66-
| Upgrade to Pydantic 2.0 | 0.9.0 | No |
44+
| Upgrade to Pydantic 2.0 | 0.9.0 | Yes |
6745
| Uplift Pyspark to 4.0+ | TBA | No |
6846
| Polars upgrade to v1+ | TBA | No |
6947
| DuckDB upgrade to v1.5+ | TBA | No |
@@ -73,7 +51,7 @@ Below is a list of features that we would like to implement or have been request
7351
If you are interested in getting any of the unreleased features listed above available, then please read the [Contributing](#Contributing) section and then submit us a pull request.
7452

7553
## Contributing
76-
Please see guidance [here](https://github.com/NHSDigital/data-validation-engine/blob/main/CONTRIBUTE.md).
54+
Please see guidance [here ↗️](https://github.com/NHSDigital/data-validation-engine/blob/main/CONTRIBUTE.md).
7755

7856
## Legal
7957
This codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

SECURITY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Security
2+
3+
We take security and the protection of private data extremely seriously. If you believe you have found a vulnerability or other issue which has compromised or could compromise the security of any of our systems or private data managed by our systems, please do not hesitate to contact us using the method outlined below.
4+
5+
## Table of contents
6+
7+
- [Security](#security)
8+
- [Table of contents](#table-of-contents)
9+
- [Reporting a vulnerability](#reporting-a-vulnerability)
10+
- [General security enquiries](#general-security-enquiries)
11+
12+
## Reporting a vulnerability
13+
14+
If you believe you have found a security issue in this repository, please report it using GitHub's private vulnerability reporting:
15+
16+
1. [Report a vulnerability](https://github.com/NHSDigital/data-validation-engine/security/advisories/new)
17+
2. Provide details of the issue and steps to reproduce
18+
19+
This creates a private channel for discussion and allows us to coordinate a fix before any public disclosure.
20+
21+
## General security enquiries
22+
23+
If you have general enquiries regarding our cybersecurity, please reach out to us at [cybersecurity@nhs.net](cybersecurity@nhs.net)

docs/advanced_guidance/json_schemas.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ For autocomplete support in VS Code, you can alter the `.vscode/settings.json` a
1717
],
1818
"url": "./json_schemas/dataset.schema.json"
1919
},
20+
{
21+
"fileMatch": [
22+
"*_data_contract_error_details.json"
23+
],
24+
"url": "./json_schemas/contract/error_details.schema.json"
25+
},
2026
{
2127
"fileMatch": [
2228
"*.rulestore.json",

docs/advanced_guidance/json_schemas/contract/components/base_entity.schema.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://json-schema.org/draft-07/schema",
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "data-ingest:contract/components/base_entity.schema.json",
44
"title": "base_entity",
55
"description": "A complete entity specification within data ingest",
@@ -10,7 +10,8 @@
1010
"description": "A mapping of field names to their Python types. These will either be strings representing Python types (if there are no argumements to the type), and field specification objects otherwise",
1111
"additionalProperties": {
1212
"$ref": "field.schema.json"
13-
}
13+
},
14+
"minProperties": 1
1415
},
1516
"aliases": {
1617
"description": "A mapping of field name to allowed field alias",
@@ -26,5 +27,7 @@
2627
"type": "string"
2728
}
2829
}
29-
}
30+
},
31+
32+
"required": ["fields"]
3033
}

docs/advanced_guidance/json_schemas/contract/components/contact_error_details.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://json-schema.org/draft-07/schema",
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "data-ingest:contract/components/contract_error_details.schema.json",
44
"title": "base_entity",
55
"description": "A mapping of field names to the custom error code and message required if these fields were to fail validation during the data contract phase. For nested fields, these should be specified using struct '.' notation (eg. fieldA.fieldB.fieldC)",

docs/advanced_guidance/json_schemas/contract/components/entity.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://json-schema.org/draft-07/schema",
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
33
"$id": "data-ingest:contract/components/entity.schema.json",
44
"title": "entity",
55
"description": "A concrete entity specification within data ingest",

0 commit comments

Comments
 (0)