Validating Datetime Values and Data Freshness

Use date/datetime-based validations to ensure your data is current and within expected time ranges.

Pointblank Validation
2025-06-22|01:26:51
Polars
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#4CA64C 1
specially
specially()

Recent data availability check: there is data in the last 3 days.

EXPR 1 1
1.00
0
0.00
#4CA64C66 2
col_vals_between
col_vals_between()

Date range validation.

timestamp [2021-01-01, 2023-12-31] 50.0K 49.6K
0.99
374
0.01
#4CA64C66 3
col_vals_not_null
col_vals_not_null()

No missing timestamps.

timestamp 50.0K 49.7K
0.99
320
0.01
2025-06-22 01:26:51 UTC< 1 s2025-06-22 01:26:51 UTC
import pointblank as pb
import polars as pl
from datetime import date, timedelta

# Supposing it is 2023-12-31, there should be data available in the last 3 days
cutoff_date = date(2023, 12, 31) - timedelta(days=3)

validation = (
    pb.Validate(
        data=pb.load_dataset(dataset="global_sales", tbl_type="polars")
    )
    .specially(
        expr=lambda df: df.filter(pl.col("timestamp") >= cutoff_date).height > 0,
        brief="Recent data availability check: there is data in the last 3 days."
    )
    .col_vals_between(
        columns="timestamp",
        left="2021-01-01",
        right="2023-12-31",
        brief="Date range validation."
    )
    .col_vals_not_null(
        columns="timestamp",
        brief="No missing timestamps."
    )
    .interrogate()
)

validation
Preview of Input Table
PolarsRows50,000Columns20
product_id
String
product_category
String
customer_id
String
customer_segment
String
region
String
country
String
city
String
timestamp
Datetime
quarter
String
month
Int64
year
Int64
price
Float64
quantity
Int64
status
String
email
String
revenue
Float64
tax
Float64
total
Float64
payment_method
String
sales_channel
String
1 98b70df0 Manufacturing cf3b13c7 Government Asia Pacific Australia Melbourne 2021-12-25 19:00:00 2021-Q4 12 2021 186.0 7 returned user1651@test.org 1302.0 127.45 1429.45 Apple Pay Partner
2 9d09fef5 Manufacturing 08b5db12 Consumer Europe France Nice 2022-06-12 17:25:00 2022-Q2 6 2022 137.03 8 returned user5200@company.io 1096.24 222.52 1318.76 PayPal Distributor
3 8ac6b077 Retail 41079b2e Consumer Europe France Toulouse 2023-05-06 09:09:00 2023-Q2 5 2023 330.08 4 shipped user9180@mockdata.com 1320.32 260.89 1581.21 PayPal Phone
4 13d2df9d Healthcare b421eece Consumer North America USA Miami 2023-10-11 16:53:00 2023-Q4 10 2023 420.09 3 shipped user1636@example.com 1260.27 103.99 1364.26 Bank Transfer Phone
5 98b70df0 Manufacturing 5906a04f SMB North America Canada Calgary 2022-05-05 01:53:00 2022-Q2 5 2022 187.77 3 delivered user9971@mockdata.com 563.31 75.73 639.04 Credit Card Phone
49996 53a36468 Finance 966a8bbe Government Asia Pacific Australia Melbourne 2023-11-04 14:45:00 2023-Q4 11 2023 198.18 1 pending user8593@test.org 198.18 18.3 216.48 Google Pay Partner
49997 a42fd1ff Healthcare ff8933e4 SMB Asia Pacific Japan Kyoto 2023-04-27 17:27:00 2023-Q2 4 2023 419.72 2 returned user5448@company.io 839.44 90.49 929.93 Google Pay Partner
49998 bbf158d2 Technology f0c0af3f Enterprise North America USA Los Angeles 2021-04-24 23:15:00 2021-Q2 4 2021 302.52 1 pending user1463@test.org 302.52 21.68 324.2 Bank Transfer Online
49999 2a0866de Healthcare 5b27ba59 SMB Europe France Nice 2023-12-30 19:44:00 2023-Q4 12 2023 433.82 5 pending user4167@test.org 2169.1 448.87 2617.97 Credit Card Online
50000 6260f67c Technology 482c1d84 Consumer Asia Pacific Japan Kyoto 2021-12-05 09:49:00 2021-Q4 12 2021 400.31 8 returned user4238@example.com 3202.48 339.84 3542.32 Apple Pay Distributor