Skip to content

fix: change flag in explorers to accept numerical categorical#661

Open
Felipedino wants to merge 2 commits into
developfrom
fix/explorer-typecheck
Open

fix: change flag in explorers to accept numerical categorical#661
Felipedino wants to merge 2 commits into
developfrom
fix/explorer-typecheck

Conversation

@Felipedino
Copy link
Copy Markdown
Collaborator

This pull request refactors how per-type dtype restrictions are handled in both the backend and frontend, replacing the old numeric_categorical_only flag with a more flexible type_dtype_restrictions mapping. This change improves clarity, extensibility, and consistency across the codebase. It also updates relevant validation logic and tests, and ensures the frontend properly respects these backend restrictions when selecting columns.

Backend changes:

  • Replaced the numeric_categorical_only flag in explorer metadata with a new type_dtype_restrictions dictionary, allowing explicit per-type dtype exclusions (e.g., for Categorical, exclude string, bool, and empty dtypes). This is reflected in all relevant explorer classes. [1] [2] [3] [4] [5] [6] [7]
  • Updated get_metadata in base_explorer.py to remove internal-only flags (numeric_categorical_only), always include type_dtype_restrictions, and ensure the frontend receives the correct metadata.
  • Refactored the validate_columns logic to use type_dtype_restrictions for per-type dtype validation instead of the old flag. [1] [2]

Frontend changes:

  • Updated the ColumnSelector component and its consumers to accept and enforce typesDtypeRestrictions when determining valid/invalid columns for selection. [1] [2] [3] [4] [5] [6] [7]
  • Ensured that column validation in the right sidebar and explorer creation step respects these backend-provided dtype restrictions. [1] [2] [3] [4]

Testing improvements:

  • Updated and expanded tests to cover the new type_dtype_restrictions logic, including positive and negative cases, and checks for correct metadata emission and legacy flag removal.

These changes collectively make dtype restrictions more explicit and maintainable, and ensure consistent enforcement across the backend and frontend.

Copilot AI review requested due to automatic review settings May 29, 2026 21:28
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 replaces the explorer-specific numeric_categorical_only flag with a more general type_dtype_restrictions metadata mapping, and wires that restriction through backend validation and notebook frontend column selection.

Changes:

  • Backend explorer metadata now emits type_dtype_restrictions and validation enforces per-type dtype exclusions.
  • Affected explorers now declare categorical dtype exclusions explicitly.
  • Notebook frontend column filtering now consumes type_dtype_restrictions.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
DashAI/back/exploration/base_explorer.py Adds metadata defaulting/removal behavior and validates per-type dtype restrictions.
DashAI/back/exploration/explorers/corr_matrix.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/cov_matrix.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/ecdf_plot.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/multibox_plot.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/parallel_cordinates.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/scatter_matrix.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/back/exploration/explorers/scatter_plot.py Replaces legacy categorical numeric flag with explicit dtype restrictions.
DashAI/front/src/components/notebooks/ColumnSelector.jsx Applies backend dtype restrictions when determining valid/selectable columns.
DashAI/front/src/components/notebooks/RightBar.jsx Applies backend dtype restrictions when determining whether explorers are available.
DashAI/front/src/components/notebooks/explorerCreation/ScopeStepExplorer.jsx Passes explorer dtype restrictions into the column selector.
tests/back/exploration/test_base_explorer_metadata.py Updates backend metadata and validation tests for the new restriction model.

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

Comment thread DashAI/front/src/components/notebooks/ColumnSelector.jsx Outdated
Comment thread DashAI/front/src/components/notebooks/RightBar.jsx Outdated
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.

2 participants