-
Notifications
You must be signed in to change notification settings - Fork 15.9k
fix(native-filters): prevent circular dependencies and improve dependency handling #35317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(native-filters): prevent circular dependencies and improve dependency handling #35317
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review by Korbit AI
Korbit automatically attempts to detect when you fix issues in new commits.
Category | Issue | Status |
---|---|---|
Inefficient circular dependency checking ▹ view | 🧠 Not in standard | |
Unnecessary array copying in dependency map ▹ view | 🧠 Not in scope | |
Overly broad useMemo dependencies ▹ view | 🧠 Incorrect | |
Inconsistent dependency UI state ▹ view | 🧠 Incorrect |
Files scanned
File Path | Reviewed |
---|---|
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/DependencyList.tsx | ✅ |
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.tsx | ✅ |
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/FiltersConfigForm.tsx | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
const availableFilters = useMemo( | ||
() => getAvailableFilters(filterId), | ||
[getAvailableFilters, filterId, filters], | ||
); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
{canDependOnOtherFilters && | ||
hasAvailableFilters && ( | ||
(hasAvailableFilters || | ||
dependencies.length > 0) && ( |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Object.keys(filters).forEach(key => { | ||
const formItem = filters[key]; | ||
const configItem = filterConfigMap[key]; | ||
let array: string[] = []; | ||
if (formItem && 'dependencies' in formItem) { | ||
array = [...formItem.dependencies]; | ||
} else if (configItem?.cascadeParentIds) { | ||
array = [...configItem.cascadeParentIds]; | ||
} | ||
dependencyMap.set(key, array); | ||
}); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
const testDependencies = [...currentDependencies, id]; | ||
const testMap = new Map(dependencyMap); | ||
testMap.set(filterId, testDependencies); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
SUMMARY
This PR fixes circular dependency issues in dashboard native filters and improves dependency handling. The changes include:
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION