feat(system): add typed show_components columns#160
Open
pesap wants to merge 1 commit into
Open
Conversation
3fbac54 to
6e5d1b8
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
+ Coverage 94.82% 94.94% +0.11%
==========================================
Files 61 62 +1
Lines 6072 6176 +104
==========================================
+ Hits 5758 5864 +106
+ Misses 314 312 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
pesap
commented
Jun 11, 2026
6e5d1b8 to
fe24cfd
Compare
fe24cfd to
54545e2
Compare
pesap
commented
Jun 11, 2026
54545e2 to
cba3bc1
Compare
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.
Closes #159
Summary
ComponentColumn[T]support for computedSystem.show_components()columns.show_components()to render selected component fields from a bare string, tuple, or list.filter_funcsupport and clearISInvalidParametererrors for invalid fields and failed computed-column extractors.system_info.py, withSystem.show_components()as a thin public API wrapper.Acceptance criteria
show_components(ComponentType),show_components(ComponentType, show_uuid=True),show_components(ComponentType, show_time_series=True), andshow_components(ComponentType, show_supplemental=True).test_system_show_componentscovers the existing call shapes.show_components(ComponentType, "field_name")renders that component field as one additional column.test_system_show_components_with_component_fieldscovers bare string input.show_components(ComponentType, ("field_a", "field_b"))renders multiple additional columns.test_system_show_components_with_component_fieldscovers tuple input.show_components(ComponentType, ["field_a", "field_b"])renders multiple additional columns.test_system_show_components_with_component_fieldscovers list input.ComponentColumn[T]or equivalent supports computed columns with callable extractors.test_system_show_components_with_computed_columncoversComponentColumn[SimpleBus].filter_funcis accepted and applied to the same selected component subtype ascomponent_type.test_system_show_components_with_filter_funcfiltersSimpleBusrows.infrasysexception that identifies the missing column and component involved.test_system_show_components_invalid_field_nameassertsISInvalidParametermentions the field andSimpleBus.infrasysexception that identifies the failing column and component involved.test_system_show_components_computed_column_failureassertsISInvalidParametermentions the column and component label."voltage"renders successfully as a field column.Deviations from the original plan
uv run mypy src testsstill reports unrelated pre-existing errors in supplemental attribute code/tests; touched files passuv run mypy src/infrasys/system.py src/infrasys/system_info.py tests/test_system.py.Testing Strategy
uv run pytest tests/test_system.py -k 'show_components or system_info' uv run ruff check src tests uv run ruff format src tests --check uv run mypy src/infrasys/system.py src/infrasys/system_info.py tests/test_system.py uv run mypy src testsReferences