Skip to content

fix numeric formatting and handle null values in NumericTab#538

Merged
cristian-tamblay merged 2 commits into
developfrom
fix/numerictab-tofixed
Apr 13, 2026
Merged

fix numeric formatting and handle null values in NumericTab#538
cristian-tamblay merged 2 commits into
developfrom
fix/numerictab-tofixed

Conversation

@Felipedino
Copy link
Copy Markdown
Collaborator

This pull request improves the robustness and user experience of the NumericTab component by adding safer handling and formatting of numerical statistics, ensuring that missing or invalid data is gracefully displayed as "N/A" instead of causing errors. It also enhances the reliability of the boxplot and warning displays by validating data before rendering.

Key improvements:

Robust number handling and formatting:

  • Introduced utility functions toNumberOrNull and formatNumber to safely parse and format numeric values, displaying "N/A" when data is missing or invalid. These functions are now used throughout the component for all numeric statistics.
  • Updated all displayed statistics (mean, median, std, quartiles, bounds, min, max, skewness, kurtosis, etc.) to use these new formatting functions, preventing runtime errors from undefined or non-numeric values. [1] [2] [3]

Boxplot and outlier display reliability:

  • Added checks to ensure all required boxplot data is present and valid before rendering the boxplot, preventing crashes when data is missing.
  • Updated boxplot and outlier trace construction to use safely parsed numbers and the new formatting functions for display and hover templates. [1] [2] [3] [4]

Conditional warnings and alerts:

  • Modified outlier and skewness warnings to only display when the relevant statistics are present and valid, avoiding false positives or errors when data is missing. [1] [2]

Copilot AI review requested due to automatic review settings April 13, 2026 13:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the NumericTab dataset analysis UI by making numeric rendering tolerant of missing/invalid values, preventing toFixed() crashes and improving conditional rendering for plots and warnings.

Changes:

  • Added toNumberOrNull / formatNumber helpers and applied them across displayed numeric statistics.
  • Made rendering resilient to absent numericStats and guarded boxplot/outlier rendering behind data validity checks.
  • Adjusted warning display conditions (outliers/skewness) to avoid errors when values are missing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread DashAI/front/src/components/notebooks/dataset/tabs/NumericTab.jsx
Comment thread DashAI/front/src/components/notebooks/dataset/tabs/NumericTab.jsx Outdated
Comment thread DashAI/front/src/components/notebooks/dataset/tabs/NumericTab.jsx Outdated
@cristian-tamblay cristian-tamblay merged commit da0aead into develop Apr 13, 2026
19 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/numerictab-tofixed branch April 13, 2026 21:21
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.

3 participants