Skip to content

fix(AlteredSliceTag): not display undefined filter value for chart change record#38883

Merged
michael-s-molina merged 1 commit intomasterfrom
fix/not-displaying-undefined-filter-val-for-chart-change-record
Mar 31, 2026
Merged

fix(AlteredSliceTag): not display undefined filter value for chart change record#38883
michael-s-molina merged 1 commit intomasterfrom
fix/not-displaying-undefined-filter-val-for-chart-change-record

Conversation

@hainenber
Copy link
Copy Markdown
Contributor

@hainenber hainenber commented Mar 26, 2026

User description

fix(AlteredSliceTag): not display undefined filter value for chart change record

SUMMARY

Fixes #38811

Dosu bot suggested to skip appending filterVal only for unary operator. IMO, we should take account of any possible filter that yields empty filterValue and skip appending.

Unit test added

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before
image

After
image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

CodeAnt-AI Description

Stop showing undefined filter values in chart change records

What Changed

  • Chart change records no longer show an undefined filter value when a filter has no comparator value
  • Unary filters now display only the operator and subject, instead of ending with an empty value
  • Added a test to cover unary and multi-value filter formatting

Impact

✅ Clearer chart change history
✅ Fewer confusing undefined filter labels
✅ More accurate filter summaries

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

…ange record

Signed-off-by: hainenber <dotronghai96@gmail.com>
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Mar 26, 2026

Code Review Agent Run #92568f

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/components/AlteredSliceTag/utils/index.ts - 1
    • Incorrect falsy check omits valid empty comparators · Line 55-55
      The change uses `filterVal ?` which omits empty string comparators, but empty strings are valid `FilterItemType.comparator` values that should be displayed (e.g., for filters like `name == ''`). This alters observable behavior for valid inputs.
      Code suggestion
       @@ -55,1 +55,1 @@
      -        return filterVal ? `${v.subject} ${v.operator} ${filterVal}` : `${v.subject} ${v.operator}`;
      +        return filterVal !== undefined ? `${v.subject} ${v.operator} ${filterVal}` : `${v.subject} ${v.operator}`;
Review Details
  • Files reviewed - 2 · Commit Range: 4450285..4450285
    • superset-frontend/src/components/AlteredSliceTag/utils/index.ts
    • superset-frontend/src/components/AlteredSliceTag/utils/utils.test.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the explore:filter Related to filters in Explore label Mar 26, 2026
@codeant-ai-for-open-source codeant-ai-for-open-source Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Mar 26, 2026
@codeant-ai-for-open-source
Copy link
Copy Markdown
Contributor

Sequence Diagram

This PR updates how adhoc filter diffs are formatted so that filters without a comparator no longer show an undefined value, instead displaying only the subject and operator while preserving normal formatting for filters with values.

sequenceDiagram
    participant User
    participant ChartControls
    participant AlteredSliceTag
    participant FormatValueHandler

    User->>ChartControls: Change adhoc filter
    ChartControls->>AlteredSliceTag: Send control diffs including filters
    AlteredSliceTag->>FormatValueHandler: Format adhoc filter diff value
    FormatValueHandler->>FormatValueHandler: Build string and skip empty filter value
    FormatValueHandler-->>AlteredSliceTag: Return formatted filter summary text
    AlteredSliceTag-->>User: Show updated chart change summary without undefined value
Loading

Generated by CodeAnt AI

@michael-s-molina michael-s-molina merged commit 11f2140 into master Mar 31, 2026
73 of 76 checks passed
@michael-s-molina michael-s-molina deleted the fix/not-displaying-undefined-filter-val-for-chart-change-record branch March 31, 2026 13:38
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 31, 2026
…ange record (apache#38883)

Signed-off-by: hainenber <dotronghai96@gmail.com>
michael-s-molina pushed a commit that referenced this pull request Apr 1, 2026
…ange record (#38883)

Signed-off-by: hainenber <dotronghai96@gmail.com>
(cherry picked from commit 11f2140)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore:filter Related to filters in Explore size/S size:S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chart changes display when "IS NULL" selected in drowdon

2 participants