A PySpark package to check missing dates in tables
Project description
Date Validator PySpark
A PySpark utility for validating date completeness in tables.
Installation
pip install pyspark-date-validator
Example Usage
Validating Multiple Tables with MultipleTablesValidator
Run checks across multiple tables and raise an error if any have missing dates.
from date_validator import MultipleTablesValidator
# Define table configurations
table_configs = [
{"table_name": "table1", "start_date": "2023-01-01", "end_date": "2023-01-05", "frequency": "daily"},
{"table_name": "table2", "start_date": "2023-01-01", "end_date": "2023-03-31", "frequency": "monthly"}
]
# Run validation
validator = MultipleTablesValidator(table_configs)
validator.run_checks()
# Output:
# Missing dates in table 'table1' (daily):
# +----------+
# | as_at_dt|
# +----------+
# |2023-01-02|
# |2023-01-04|
# |2023-01-05|
# +----------+
# Missing dates in table 'table2' (monthly):
# +----------+
# | as_at_dt|
# +----------+
# |2023-02-28|
# +----------+
# ValueError: Missing dates detected in one or more tables.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyspark_date_validator-0.2.2.tar.gz.
File metadata
- Download URL: pyspark_date_validator-0.2.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8ddb603b5484cf57c9c2d583e5c3102323817db60d9ed83df6a1d2f6e9a708f
|
|
| MD5 |
fcc1f23eff705fdba5a122d49e88ea9a
|
|
| BLAKE2b-256 |
4275666ade4fe97f876cf0648bae49148a03766c1e47e36f4946ba28b459ef5e
|
File details
Details for the file pyspark_date_validator-0.2.2-py3-none-any.whl.
File metadata
- Download URL: pyspark_date_validator-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4712232a47104f5cad7c597de7e48d4b6f99f84db941cf8726157733451b51b
|
|
| MD5 |
435eb0f50324b945688e9d4d3ccb1514
|
|
| BLAKE2b-256 |
ea6ba2168cc67015a3f9b390ba0e2a3e689e3c30a14cb1b709a6be06d906855d
|