Testing GroupBys, Joins and StagingQuerys
This doc assumes that you have already a GroupBy, Join, or StagingQuery created that you wish to test.
Compile
Compiling takes your python files, validates them for correctness, and produces serialized files that you can use in futures steps.
From the root of the main Chronon directory, run:
zipline compileThis will show you errors if there are any in your definitions, and show you changes.
Note, if you are making a change to any existing entities without changing the version it will prompt you with a warning.
Validate
Use zipline hub validate for configs and zipline hub validate-table for table schemas.
The old eval and eval-table commands remain deprecated aliases and warn on stderr.
Use VALIDATE_URL in team configuration or the environment, or --validate-url for a one-off override. EVAL_URL and --eval-url remain deprecated aliases.
Explicit flags override environment variables, which override team configuration.
Within one source, VALIDATE_URL takes precedence over EVAL_URL; passing both
URL flags is an error. The service addresses and API routes have not changed.
Before running expensive backfill jobs, use validate to quickly validate your configuration. Validation checks that:
- All source tables exist and are accessible
- Column names and types match your configuration
- Query syntax is valid (for StagingQueries)
- Derivations compile and type-check correctly
- Dependencies between configurations resolve correctly
Prerequisites
Set VALIDATE_URL in your team's env.common in teams.py so zipline hub validate knows where to reach the validation service. For example:
default = Team(
conf=ConfigProperties(
...
),
env=EnvironmentVariables(
common={
...
"VALIDATE_URL": "https://your-hub.zipline.ai/services/eval",
},
),
)Without this, validation invocations will fail to dispatch to the validation service. The CLI also accepts --validate-url as a one-off override.
Quick Schema Validation
The most common use case - validate your configuration without running any computations:
zipline hub validate compiled/joins/{team}/{your_conf}This will show you the output schema, lineage, and catch configuration errors early. Example output:
🟢 Validation finished successfully
Join Configuration: gcp.demo.user_features__1
- Left table: data.user_activity_7d__0
- Join parts: 2
- Conf dependencies: 3
- External tables: 2
- Output Schema:
[left] user_id: string
[left] event_timestamp: long
[left] ds: string
[joinPart: gcp.user_demographics__0] user_id_age: integer
[derivation] is_adult: boolean
Lineage:
[Join] gcp.demo.user_features__1
├── ✅ [GroupBy] gcp.user_activity_7d__0
│ └── External: project.events.user_clicks
└── ✅ [GroupBy] gcp.user_demographics__0
└── ✅ [StagingQuery] gcp.raw_demographics__0Testing with Sample Data
For deeper validation, provide sample data to see actual computation output:
# 1. Generate a test data skeleton
zipline hub validate compiled/joins/{team}/{your_conf} --generate-test-config
# 2. Fill in test-data.yaml with sample data (use !epoch for timestamps)
# 3. Run validation with test data
zipline hub validate compiled/joins/{team}/{your_conf} --test-data-path test-data.yamlThis will show you the actual computed results with your sample data, helping you validate:
- Complex aggregations and window functions
- Derivation logic with concrete examples
- Join key matching behavior
- Null value handling
Backfill
zipline hub backfill compiled/{group_bys|staging_queries|joins}/{team}/{your_conf} --start-ds {YYYY-MM-DD} --end-ds {YYYY-MM-DD}This will give you a URL to track the progress of your backfill.
--start-ds and --end-ds also accept sub-daily partitions. Daily inputs are
sent to Hub as YYYY-MM-DD; sub-daily inputs are normalized to YYYY-MM-DD-HH-mm. These forms are equivalent:
--start-ds 2024-01-15-03 --end-ds 2024-01-15-06-30
--start-ds "2024-01-15 03:00" --end-ds "2024-01-15T06:30"
--start-ds "2024/01/15 03:00:00" --end-ds "2024-01-15-06:30"Partition values must validate as real dates and times. Second precision is only
accepted when seconds are 00, because Chronon partitions are minute-aligned.
For authoring semantics, see Schedules.
You can also see your previously run jobs in the home page of the Zipline.AI Hub UI.
Generally, it's suggested to run a small range of data first to perform validation, then proceed with the entire desired range.
Once the job is complete you can query your table to see the computed data (note the table name is in the overview section of the Zipline.AI Hub UI for convenience).
If you wish to re-run a given range that is already marked as completed, then you'll also need to pass the --force-recompute flag. This can be used when you made a change that you wish to take effect, or when upstream data has changed and you wish to propogate the change to Chronon output.
(Optional) Schedule
Running schedule from a branch will tell Zipline.AI to run the regular jobs associated with your config.
Note: Configs on the production branch are automatically scheduled only when your repository's CI runs zipline hub schedule-all after merges. With that integration configured, use schedule manually from a branch when you want recurring runs without merging to production.
This is helpful when you want to run an extended A/B test or experiment with the data pipeline. Otherwise, merge your PR and let the configured schedule-all CI step deploy it to production.
zipline hub schedule compiled/{group_bys|staging_queries|joins}/{team}/{your_conf}This will run:
- Frontfill jobs into the output table (if the
offline_scheduleargument is set on your entity) - Batch upload jobs for serving (if
online=True) - Streaming jobs (if a topic is configured for the
GroupBybeing scheduled)