πβ fix Sensor silently collapsing for multi-variable output onto one column - #27
Open
Tesshub wants to merge 1 commit into
Open
πβ
fix Sensor silently collapsing for multi-variable output onto one column#27Tesshub wants to merge 1 commit into
Tesshub wants to merge 1 commit into
Conversation
Sensor.post_process tagged every variable's columns with the same
f"_{self.variables}" (the whole list stringified), and get_output_variable's
drop_suffix regex embedded the raw variables param unescaped, turning it into
a corrupted character class - both caused columns from different variables to
end up identically named and get deduplicated away downstream.
Sensor.post_process now loops per variable so each gets its own correctly
tagged columns, and get_output_variable builds its strip regex from the
already-parsed/escaped variable_names_list instead of the raw param.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
When a Sensor was created with a list of variables (e.g. heating + cooling energy), all the results ended up merged into a single column instead of one column per variable β silently, with no error.
Two bugs combined to cause this:
Both are fixed now: each variable gets its own correctly named columns, and the regex is safe. Added tests covering multi-variable sensors to prevent this from happening again.