Skip to content

fix(registers): pass back_populate by keyword instead of a logger - #10

Open
adamsrnmsu wants to merge 1 commit into
sandialabs:mainfrom
adamsrnmsu:fix-registers-load-regstate-args
Open

adamsrnmsu wants to merge 1 commit into
sandialabs:mainfrom
adamsrnmsu:fix-registers-load-regstate-args

Conversation

@adamsrnmsu

Copy link
Copy Markdown
Collaborator

Description

webapp/registers/utility.py get_reg_state called load_regstate(reg_ops, logger). load_regstate has no logger parameter; its second positional parameter is back_populate, so the (always truthy) logger is what turned back-population on for every register state the webapp loads.

The Registers page depends on that back-population: it fills each register's leading NaNs with its first value, which the charts and the State tab's hdbscan clustering expect. So this keeps the behavior and states it: load_regstate(reg_ops, back_populate=True). No change in what the page shows.

Related Issues/PRs

Type of Change

  • Bugfix (fix)
  • Feature (feat)
  • Documentation (docs)
  • Refactor (refactor)
  • Chore (CI, build, dependencies, etc.) (chore)
  • Other (please describe):

Checklist

Testing

  • New tests/test_registers_utility.py: load_regstate gets one positional argument and back_populate=True. Fails on main (the logger is passed positionally) and passes with the fix.
  • Full suite on macOS without an Elasticsearch server: the same 21 failures and 1 error as main and no new ones (Elasticsearch tests that need a server, plus the macOS-only test_build_paths_uses_var_lib_for_manifest_state).

🤖 Generated with Claude Code

get_reg_state in webapp/registers/utility.py called
load_regstate(reg_ops, logger). load_regstate has no logger parameter;
its second positional parameter is back_populate, so the logger object
(always truthy) is what turned back-population on for every register
state the webapp loads.

The Registers page depends on that back-population: it fills each
register's leading NaNs with its first value, and the charts and the
State tab's hdbscan clustering expect no leading gaps. So the fix keeps
the behavior and states it: load_regstate(reg_ops, back_populate=True).
This was the only caller of load_regstate in src.

Verified:
- new tests/test_registers_utility.py asserts load_regstate gets one
  positional argument and back_populate=True; it fails on main (the
  logger is passed positionally) and passes with the fix
- full pytest: same results as main apart from the new test (failures
  are Elasticsearch tests with no server running, plus the known
  macOS-only test_build_paths_uses_var_lib_for_manifest_state)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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