Antonio-RiveroMartnez commented on code in PR #24580:
URL: https://github.com/apache/superset/pull/24580#discussion_r1253343324
##########
superset/databases/filters.py:
##########
@@ -41,6 +41,16 @@ class DatabaseFilter(BaseFilter): # pylint:
disable=too-few-public-methods
# TODO(bogdan): consider caching.
def apply(self, query: Query, value: Any) -> Query:
+ # Dynamic Filters need to be applied to the Query before we filter
+ # databases with anything else. This way you can show/hide databases
using
+ # Feature Flags for example in conjuction with the regular role
filtering.
+ # If not, if an user has access to all Databases it would skip this
dynamic
+ # filtering.
+
+ if dynamic_filter :=
current_app.config["EXTRA_DYNAMIC_DATABASE_FILTER"]:
+ query = dynamic_filter(query)
Review Comment:
Hmm how so? `dynamic_filter` is only defined if the
`EXTRA_DYNAMIC_DATABASE_FILTER ` is defined in the config and if so, it will
apply it to the query, otherwise the code is never going to enter into this
conditional.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]