You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "butuzov (via GitHub)" <gi...@apache.org> on 2024/02/14 15:38:43 UTC

[PR] fix(db): KeyError [superset]

butuzov opened a new pull request, #27114:
URL: https://github.com/apache/superset/pull/27114

   This PR fixes KeyError (Settingitself used for testing propeposes)
   
   ## ERROR
   
   <details><summary>Details</summary>
   <pre>
   superset-superset_app-1  | 2024-02-14 15:25:00,219:DEBUG:urllib3.connectionpool:https://json-schema.org:443 "GET /draft/2020-12/meta/content HTTP/1.1" 200 423
   superset-superset_app-1  | 'EXTRA_DYNAMIC_QUERY_FILTERS'
   superset-superset_app-1  | Traceback (most recent call last):
   superset-superset_app-1  |   File "/app/superset/views/base.py", line 254, in wraps
   superset-superset_app-1  |     return f(self, *args, **kwargs)
   superset-superset_app-1  |   File "/app/superset/views/base_api.py", line 487, in get_list_headless
   superset-superset_app-1  |     duration, response = time_function(super().get_list_headless, **kwargs)
   superset-superset_app-1  |   File "/app/superset/utils/core.py", line 1518, in time_function
   superset-superset_app-1  |     response = func(*args, **kwargs)
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/api/__init__.py", line 1603, in get_list_headless
   superset-superset_app-1  |     count, lst = self.datamodel.query(
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/models/sqla/interface.py", line 489, in query
   superset-superset_app-1  |     count = self.query_count(query, filters, select_columns)
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/models/sqla/interface.py", line 396, in query_count
   superset-superset_app-1  |     return self._apply_inner_all(
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/models/sqla/interface.py", line 382, in _apply_inner_all
   superset-superset_app-1  |     query = self.apply_filters(query, inner_filters)
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/models/sqla/interface.py", line 219, in apply_filters
   superset-superset_app-1  |     return filters.apply_all(query)
   superset-superset_app-1  |   File "/usr/local/lib/python3.9/site-packages/flask_appbuilder/models/filters.py", line 302, in apply_all
   superset-superset_app-1  |     query = flt.apply(query, values)
   superset-superset_app-1  |   File "/app/superset/databases/filters.py", line 52, in apply
   superset-superset_app-1  |     if dynamic_filters := current_app.config["EXTRA_DYNAMIC_QUERY_FILTERS"]:
   superset-superset_app-1  | KeyError: 'EXTRA_DYNAMIC_QUERY_FILTERS'
   </pre>
   </details> 
   
   ### SUMMARY
   Switch to default option for key look up.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   ### TESTING INSTRUCTIONS
    
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(db): KeyError [superset]

Posted by "butuzov (via GitHub)" <gi...@apache.org>.
butuzov closed pull request #27114: fix(db): KeyError
URL: https://github.com/apache/superset/pull/27114


-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(db): KeyError [superset]

Posted by "john-bodley (via GitHub)" <gi...@apache.org>.
john-bodley commented on code in PR #27114:
URL: https://github.com/apache/superset/pull/27114#discussion_r1489864474


##########
superset/databases/filters.py:
##########
@@ -49,7 +49,7 @@ def apply(self, query: Query, value: Any) -> Query:
         filtering.
         """
 
-        if dynamic_filters := current_app.config["EXTRA_DYNAMIC_QUERY_FILTERS"]:

Review Comment:
   @butuzov what we currently have seems correctly as this key _should_ always be defined per [here](https://github.com/apache/superset/blob/af577d64b17a9730e28e9021376318326fe31437/superset/config.py#L1676).



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(db): KeyError [superset]

Posted by "butuzov (via GitHub)" <gi...@apache.org>.
butuzov commented on code in PR #27114:
URL: https://github.com/apache/superset/pull/27114#discussion_r1489917642


##########
superset/databases/filters.py:
##########
@@ -49,7 +49,7 @@ def apply(self, query: Query, value: Any) -> Query:
         filtering.
         """
 
-        if dynamic_filters := current_app.config["EXTRA_DYNAMIC_QUERY_FILTERS"]:

Review Comment:
   That seams I was handed extremely customized superset codebase by another team. I will close PR, then. thank you!



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org