Fix unit_labels override writing to raw_limits in TxtLoader#603
Merged
Conversation
`parse_loader_parameters` had a copy-paste slip: the `unit_labels=` override branch updated `config_params.raw_limits` instead of `config_params.unit_labels`. Introduced in a9de15c ("implement renaming original headers based on unit labels"), whose intent was clearly to wire `unit_labels`. Effect of the bug: passing `unit_labels=` to a loader had no effect on unit labels (vendor column-name templates like neware's `Current({{ current }})` could not be overridden this way), and the unit-label strings silently polluted `raw_limits`. Add a regression test asserting a `unit_labels=` override lands in `config_params.unit_labels` and leaves `raw_limits` untouched. Found while porting loader post-processors for #560. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TxtLoader.parse_loader_parametershad a copy-paste slip in its override handling: theunit_labels=branch updatedconfig_params.raw_limitsinstead ofconfig_params.unit_labels.Why
unit_labels=to a loader had no effect on unit labels, so vendor column-name templates (e.g. neware'sCurrent({{ current }})) could not be overridden this way.raw_limitsinstead.The bug is bracketed by a correct
raw_unitsbranch above and a correctraw_limitsbranch immediately below, which is what makes it a copy-paste slip rather than intent.git blametraces it toa9de15c4— "implement renaming original headers based on unit labels" — whose stated purpose was to wireunit_labels.Test
Adds
test_unit_labels_override_lands_in_unit_labels_not_raw_limitsintests/test_loader_two_stage.py: passesunit_labels={"current": "A"}to a neware loader and asserts it lands inconfig_params.unit_labelswhileraw_limitsis unchanged. Verified it fails on the pre-fix code and passes after; the surrounding two-stage and port-parity suites stay green.Notes for reviewer
Found while porting loader post-processors for #560 (PR #601); kept out of that PR to keep it scoped to the port.
🤖 Generated with Claude Code