feat(features): implement lifecycle compute method (#109)#111
Conversation
There was a problem hiding this comment.
Sorry @w7-mgfcode, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Lands PRP-3.1B — the lifecycle compute slice for time-safe featuresets.
FeatureEngineeringService._compute_lifecycle_features(private method).compute_features, gated onself.config.lifecycle_config.launch_date/discontinue_datecolumns are absent from the input DataFrame — emits an info log and returns zero new columns. End-to-end loader extension (joining product attrs) lands in PRP-3.1E.days_since_launch_lag{N}(lagged per(store_id, product_id))days_since_discontinue_lag{N}(signed delta — LightGBM learns the sign; do not clip)Time-safety
groupby(entity).shift(lag)idiom — rowireflects only data at rowi - lag.test_leakage.pyinvariants for the existing families.Scope
service.py,tests/test_leakage.py,tests/test_service.py(3 files, +304/-0).schemas.py/routes.py/conftest.py/ migration / docs edits.config_hash_unchanged_when_phase2_omitted) still passes.Test plan
ruff check+ruff format --checkmypy --strict app/pyright --strict app/pytest -von the slice (82 tests pass)Refs
Part of #109 (Phase 2 feature wiring). PRP-3.1E will land the loader extension that actually populates
launch_date/discontinue_datefrom the product table.