Skip to content

fix: update popmon_dp_loader_example notebook for popmon 1.0+ API#1209

Open
star11293 wants to merge 1 commit into
capitalone:devfrom
star11293:fix/popmon-notebook-pydantic-compat
Open

fix: update popmon_dp_loader_example notebook for popmon 1.0+ API#1209
star11293 wants to merge 1 commit into
capitalone:devfrom
star11293:fix/popmon-notebook-pydantic-compat

Conversation

@star11293

Copy link
Copy Markdown

Fixes #1014

What was broken

The popmon_dp_loader_example.ipynb notebook errored on cell 6 with a ValidationError: 2 validation errors for Settings when run against modern popmon (v1.0+):

extended_report
Extra inputs are not permitted [type=extra_forbidden, ...]
pull_rules
Extra inputs are not permitted [type=extra_forbidden, ...]

Root cause

popmon v1.0.0 migrated to a pydantic-based Settings model with extra="forbid", which rejects the extended_report and pull_rules kwargs the notebook was passing directly to pm_stability_report.

Changes

Migrated the three pm_stability_report calls to use a Settings object:

  • extended_reportsettings.report.extended_report
  • pull_rules → renamed to monitoring_rules and moved to settings.monitoring.monitoring_rules
  • time_axis → set on settings.time_axis (the kwarg is silently ignored when settings is provided)

Added a make_settings(time_axis) helper so each call gets a fresh Settings instance, since settings.bin_specs gets mutated per-call and can't be reused across calls.

Testing

Verified the notebook executes end to end against popmon 1.4.12:

jupyter nbconvert --to notebook --execute popmon_dp_loader_example.ipynb --output /tmp/test.ipynb
[NbConvertApp] Writing 53035 bytes to /tmp/test.ipynb

All three pm_stability_report calls complete successfully and produce stability reports.

popmon v1.0.0 migrated to a pydantic-based Settings model that rejects the
extended_report and pull_rules kwargs the notebook was passing directly to
pm_stability_report, causing a ValidationError on every run with modern popmon.

Migrates the three pm_stability_report calls to use a Settings object:
- extended_report moves to settings.report.extended_report
- pull_rules is renamed to monitoring_rules and moves to
  settings.monitoring.monitoring_rules
- time_axis must be set on settings.time_axis (the kwarg is ignored when
  settings is provided)

Adds a make_settings() helper so each call gets a fresh Settings instance,
since the object's bin_specs gets mutated per-call and can't be reused.

Verified by running the notebook end-to-end against popmon 1.4.12.

Fixes capitalone#1014
@star11293 star11293 requested a review from a team as a code owner May 30, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant