Commit 604c74c
feat(synthetic_data_generator)!: orders schema matches Snowflake RAW.ORDERS spec
BREAKING: rewrites _generate_orders to emit a column shape compatible
with the canonical Snowflake RAW.ORDERS table definition used across
the Snowflake demo set. Existing consumers that depend on the old shape
will need to migrate (audited; only 2 consumers had real shape
dependencies — both updated in the paired CLI-repo commit).
Column-by-column changes:
order_id str 'ORD' + 10-digit (was 8-digit)
customer_id str 'CUST' + 6-digit (unchanged)
order_date datetime datetime object — was string (strftime)
Snowflake's write_pandas maps datetime → TIMESTAMP_NTZ
cleanly without any string-parsing fallback
category str lowercase 8-value enum (was Title Case 7-value):
electronics, clothing, books, home, sports, toys,
beauty, food
(was: Electronics, Clothing, Home & Garden, Sports,
Books, Toys, Food)
num_items int 1..10 (was 1..5)
subtotal float uniform 10..1000 (was sum-of-N-uniforms shape)
shipping float uniform 0..30 (was discrete [0, 5.99, 9.99, 14.99])
tax float unchanged formula (subtotal * 0.08)
total float unchanged formula (subtotal + shipping + tax)
status str 5-value enum (was 4 — adds "paid"):
pending, paid, shipped, delivered, cancelled
region str NEW — NA, EU, APAC, LATAM
+ date fallback: last 30 days with hours/minutes/seconds randomness
(was last 365 days, date-only randomness)
Why: the existing implementation was emitting a string timestamp and
Title-Case categories that didn't match either the Snowflake demo's
TIMESTAMP_NTZ column type or the canonical lowercase category values
used downstream. The missing region column blocked any region-based
demo aggregation. The 1..5 num_items range was unrealistic for an
e-commerce shape.
Audit of 33 downstream demos using schema_type: orders found two real
breakage sites (fixed in the companion CLI-repo commit):
- setup_data_quality_checks_demo.sh: Pandera isin([...]) check on
Title-Case categories + 4-value status enum + missing region
- setup_azure_synapse_serverless_demo.sh: stale comment listing
Title-Case categories
Other 31 consumers pass orders through to writers / notebooks without
referencing the column shape — no migration needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent b66ce5c commit 604c74c
3 files changed
Lines changed: 51 additions & 22 deletions
File tree
- assets/ai/synthetic_data_generator
- dagster_community_components
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
578 | 595 | | |
579 | 596 | | |
580 | | - | |
581 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
582 | 605 | | |
583 | | - | |
584 | | - | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
585 | 609 | | |
586 | 610 | | |
587 | 611 | | |
588 | | - | |
| 612 | + | |
589 | 613 | | |
590 | 614 | | |
591 | | - | |
592 | 615 | | |
593 | | - | |
594 | 616 | | |
595 | 617 | | |
596 | 618 | | |
597 | | - | |
| 619 | + | |
598 | 620 | | |
599 | 621 | | |
600 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
601 | 628 | | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
606 | 634 | | |
607 | 635 | | |
608 | 636 | | |
609 | 637 | | |
610 | | - | |
611 | | - | |
| 638 | + | |
| 639 | + | |
612 | 640 | | |
613 | | - | |
| 641 | + | |
614 | 642 | | |
615 | | - | |
616 | | - | |
617 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
618 | 647 | | |
619 | 648 | | |
620 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments