Tolerate missing additional data tables in code quality visualizations#113
Open
Jammy-Louie wants to merge 1 commit into
Open
Tolerate missing additional data tables in code quality visualizations#113Jammy-Louie wants to merge 1 commit into
Jammy-Louie wants to merge 1 commit into
Conversation
complexity_vs_test_gaps_bubble and code_quality_executive_dashboard read their additionalDataTables (TestGaps, MethodQualityMetrics, PackageQualityMetrics, CodeSmells) with raw pd.read_csv, which aborts the notebook with FileNotFoundError when the platform does not supply the secondary CSV path. Switch those reads to read_optional_csv (the helper already used for the release-metro notebooks in #104) so a missing optional table degrades to an empty DataFrame and the existing "No data available" guard, instead of crashing the run. Drop the now-unused pandas import in complexity_vs_test_gaps_bubble.
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.
Problem
complexity_vs_test_gaps_bubbleandcode_quality_executive_dashboardload theiradditionalDataTables(the secondary tables declared in their specs) with rawpd.read_csv(...). When the notebook runs without a path supplied for one of those tables, the parameter keeps its in-package default (e.g.../samples/test_gaps.csv), which does not resolve in the run environment, and the notebook aborts before it can render anything:Both notebooks already guard for empty data (
len(df) == 0-> "No data available"), but the raw read crashes before reaching that guard.Fix
Switch the
additionalDataTablesreads toread_optional_csv()(the helper added in fix: handle missing DependenciesDeclared in release metro visualizations #104 for the release-metro notebooks), which returns an empty DataFrame for aNone/ missing / empty path. A missing optional table then flows into the existing "No data available" guard instead of crashing.complexity_vs_test_gaps_bubble:data_file_gaps; also drop the now-unusedimport pandas as pd.code_quality_executive_dashboard:data_file_methods,data_file_packages,data_file_smells,data_file_gaps(keepspandas, still used bypd.concat/pd.Series).Test plan
papermillwith a missing/nonexistentdata_file_gaps-> runs to completion and renders the "No data available" figure (previouslyPapermillExecutionError/FileNotFoundError).papermillwith realClassQualityMetrics+TestGapsCSVs -> renders the bubble chart (2,137 points).ruff checkclean on both changed notebooks.poe check-optionspasses for both.Note