Pointblank Validation | |||||||||||||
2025-10-09|20:55:02 Polars |
|||||||||||||
STEP | COLUMNS | VALUES | TBL | EVAL | UNITS | PASS | FAIL | W | E | C | EXT | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
#4CA64C | 1 |
col_vals_ge()
Orders are from 2023 or later |
✓ | 4 | 4 1.00 |
0 0.00 |
— | — | — | — | |||
#4CA64C | 2 |
col_vals_between()
Creation timestamps within expected range |
✓ | 4 | 4 1.00 |
0 0.00 |
— | — | — | — | |||
#4CA64C | 3 |
col_vals_ge()
Timezone-aware events after 8 AM Eastern |
✓ | 4 | 4 1.00 |
0 0.00 |
— | — | — | — | |||
#4CA64C | 4 |
col_schema_match()
Schema includes proper date/datetime types |
✓ | 1 | 1 1.00 |
0 0.00 |
— | — | — | — | |||
2025-10-09 20:55:02 UTC< 1 s2025-10-09 20:55:02 UTC |
Date and Datetime Validations
pointblank provides comprehensive support for validating date and datetime values, including timezone-aware comparisons. This ensures temporal data quality in applications that handle time-sensitive information.
import pointblank as pb
import polars as pl
from datetime import date, datetime
import pytz
# Create sample data with various temporal data types
= pl.DataFrame({
temporal_data "order_date": [
2023, 1, 15),
date(2023, 6, 10),
date(2023, 12, 5),
date(2024, 3, 20)
date(
],"created_at": [
2023, 1, 15, 9, 30, 0),
datetime(2023, 6, 10, 14, 45, 30),
datetime(2023, 12, 5, 8, 15, 0),
datetime(2024, 3, 20, 17, 22, 45)
datetime(
],"event_time_tz": [
2023, 1, 15, 9, 0, tzinfo=pytz.timezone("America/New_York")),
datetime(2023, 6, 10, 12, 30, tzinfo=pytz.timezone("America/New_York")),
datetime(2023, 12, 5, 15, 45, tzinfo=pytz.timezone("America/New_York")),
datetime(2024, 3, 20, 18, 15, tzinfo=pytz.timezone("America/New_York"))
datetime(
],"order_id": [1001, 1002, 1003, 1004],
"amount": [150.0, 275.5, 89.99, 420.00]
})
= (
validation
pb.Validate(temporal_data)
.col_vals_ge(="order_date",
columns=date(2023, 1, 1),
value="Orders are from 2023 or later"
brief
)
.col_vals_between(="created_at",
columns=datetime(2023, 1, 1, 0, 0, 0),
left=datetime(2024, 12, 31, 23, 59, 59),
right="Creation timestamps within expected range"
brief
)
.col_vals_ge(="event_time_tz",
columns=datetime(2023, 1, 1, 8, 0, tzinfo=pytz.timezone("America/New_York")),
value="Timezone-aware events after 8 AM Eastern"
brief
)
.col_schema_match(
pb.Schema(=[
columns"order_date", "Date"),
("created_at", "Datetime(time_unit='us', time_zone=None)"),
("event_time_tz", "Datetime(time_unit='us', time_zone='America/New_York')"),
("order_id", "Int64"),
("amount", "Float64")
(
]
),="Schema includes proper date/datetime types"
brief
)
.interrogate()
)
validation
Preview of Input Table
PolarsRows4Columns5 |
|||||