BE-797: Add S/M/L identifiers for scale factor - #161
Conversation
e55bbd4 to
0c1bb4b
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
0c1bb4b to
1136c75
Compare
1136c75 to
699a1e4
Compare
PR SummaryMedium Risk Overview Site scaling is the other major change: generation builds Also tightens data quality: sales orders only use the India customer when present, vendor counts are parameterized, integrity checks cover more FKs, and tests document size bounds (M/L/XL gated behind env flags). Reviewed by Cursor Bugbot for commit 2ddbfb1. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
🟡 Changes recommended
The CLI’s new --scale-factor parsing can now yield uncaught ValueError tracebacks for invalid inputs, regressing argparse-level validation and error UX.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds dataset size identifiers (S, M, L, XL) as an alternative to numeric scale_factor, mapping each size to seeded per-knob ranges so generated datasets fall within the documented size bounds.
Changes:
- Introduces
SIZE_KNOB_RANGESand updatesGenerationConfigto acceptscale_factoras either a positive number or a size identifier, sampling knob values deterministically per seed/size. - Adds vendor-count as a first-class knob (
NUM_VENDORS) and wires it through generation (vendor masterdata + purchasing info records). - Updates CLI/README/tests and adjusts demo scenario configs/IDs to be compatible with small datasets.
File summaries
| File | Description |
|---|---|
| libs/sap-mock-data/tests/test_scale_sizes.py | Adds unit tests validating size identifier normalization, knob sampling, and (optionally) generated dataset size bounds. |
| libs/sap-mock-data/src/sap_mock_data/generation/transactions.py | Resets BATCH_COUNTER at generation start to keep batch IDs consistent per run. |
| libs/sap-mock-data/src/sap_mock_data/generation/masterdata.py | Makes vendor count configurable via NUM_VENDORS, adjusts vendor categorization, and aligns supplier pools accordingly. |
| libs/sap-mock-data/src/sap_mock_data/generation/common.py | Adds NUM_VENDORS to defaults and scaled knobs for numeric scaling. |
| libs/sap-mock-data/src/sap_mock_data/config.py | Implements size identifiers, deterministic sampling per size/seed, adds num_vendors, and updates demo scenario configs. |
| libs/sap-mock-data/src/sap_mock_data/cli/main.py | Extends CLI to accept size identifiers for --scale-factor and adds --vendors. |
| libs/sap-mock-data/README.md | Documents size identifiers, expected bounds table, and knob override behavior. |
| libs/sap-mock-data/pipeline/Mock-up SAP ERP data - Masterdata.py | Aligns TR lane ID generation with deterministic hex IDs (removes UUID usage). |
| libs/sap-mock-data/notebooks/databricks/Generate SAP Mock Data.py | Allows Databricks widget scale_factor to be numeric or size identifier. |
Review details
Suppressed comments (1)
libs/sap-mock-data/src/sap_mock_data/cli/main.py:107
- GenerationConfig validation errors (e.g., unknown size identifiers or invalid numeric factors) are not caught, so
sap-mock generate --scale-factor bananawill currently crash with a traceback. Wrap GenerationConfig construction and route ValueError through argparse's error() for a consistent CLI experience.
config = GenerationConfig(
random_seed=args.seed,
scale_factor=args.scale_factor,
num_orders=args.orders,
num_customers=args.customers,
num_finished_goods=args.finished_goods,
num_raw_materials=args.raw_materials,
num_vendors=args.vendors,
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
699a1e4 to
2ef150b
Compare
2ef150b to
81df4ad
Compare
|
can the sites be varies too? e.g. sites: 1-2 / 4-5 / 20-40 / 100+ The BOM depth also needs to be varied e.g. 1 / 2-3 / 3-4, I'm guessing this is more involved and requires more work? |
I think we can do this, I'll try to get this into this PR
It is a little more involved, I will track this in H-6798 |
cd14ffe to
3c55a9c
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3c55a9c. Configure here.
|
@drdma after some back and forth with the PR, i think it is in a better spot now to be merged. Will look at BOM depth soon as well |

This PR adds S/M/L/XL scale identifiers for the scale factor that fits within these bounds