Bug description

When configuring dashboard filters with the "Values are dependent on other filters" option, the system prevents creating bi-directional dependencies upfront by showing a "Cyclic dependency detected" message. However, it allows creating the same dependency indirectly after saving the initial filter configuration.

  1. If Filter A is set to depend on Filter B, the system blocks setting Filter B to depend on Filter A immediately, showing a "Cyclic dependency detected" message.
  2. However, if Filter A is saved with the dependency on Filter B, the system later allows editing Filter B to create the reverse dependency, effectively forming a bi-directional (cyclic) dependency.

This behavior is inconsistent and might lead to unexpected filter behavior. It appears to contradict the intended prevention of cyclic dependencies. How to reproduce the bug

  1. Create a dashboard filter (e.g., Filter A) with a dependency on another filter (e.g., Filter B) by enabling the Values are dependent on other filters option.
  2. Save the filter configuration.
  3. Open the dashboard filter configuration again, select Filter B, and set it to depend on Filter A.
  4. Save the changes.

Expected results

The system should prevent bi-directional (cyclic) dependencies for all filter types, not just date filters. Users should not be able to create a cyclic dependency by editing the filters after saving the initial configuration.

Actual results

The platform allows creating cyclic dependencies indirectly after the initial configuration, even though it prevents it upfront. This behavior is inconsistent and may lead to unexpected filter behavior.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.11

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: geido


🎉 Preset Bounty Available: $150 USD 🎉

To claim this bounty, please carefully follow the steps below.


📋 Steps to Participate

  1. Review Guidelines:
    Read through the Preset Bounty Program Contribution Guide for complete details on bounty requirements.

  2. Show Your Interest:
    Complete the Preset Bounty Program Survey and comment this issue to express your interest.

  3. Join the Slack Channel:
    After completing the survey, you’ll receive an invitation to the dedicated Apache Superset Slack channel.

  4. Get Assigned:
    To officially start, ensure a Bounty Program Manager has assigned you to this issue.

  5. Submit Your Solution:
    When ready, submit your solution with the Fixes #{issue_number} notation in your Pull Request description.

  6. Claim Your Bounty:
    Sign up at GitPay.me and submit your solution via: https://gitpay.me/#/task/1217


💡 Additional Notes

  • Only developers assigned by a Bounty Program Manager should start working on this issue to win the bounty.
  • Be sure to follow the guide closely to avoid any delays in payment. Please, allow a few days after your PR has been merged for the bounty to be released.

Good luck, and happy coding! 🎉

Comment From: Nandu9494

@geido I would like to take this, Please assign to me

Comment From: sfirke

I expect this is closely related to https://github.com/apache/superset/issues/22979 and possibly related to https://github.com/apache/superset/issues/24511, if anyone sees a chance to fix multiple issues in the same part of the codebase.