betodealmeida closed pull request #6548: Pass security manager to QUERY_LOGGER
URL: https://github.com/apache/incubator-superset/pull/6548
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/config.py b/superset/config.py
index 37afdd5f37..988df253b4 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -285,7 +285,14 @@
# Custom logger for auditing queries. This can be used to send ran queries to a
# structured immutable store for auditing purposes. The function is called for
# every query ran, in both SQL Lab and charts/dashboards.
-# def QUERY_LOGGER(database, query, schema=None, user=None, client=None):
+# def QUERY_LOGGER(
+# database,
+# query,
+# schema=None,
+# user=None,
+# client=None,
+# security_manager=None,
+# ):
# pass
# Set this API key to enable Mapbox visualizations
diff --git a/superset/models/core.py b/superset/models/core.py
index 6f520aa442..97dd54a400 100644
--- a/superset/models/core.py
+++ b/superset/models/core.py
@@ -813,7 +813,7 @@ def needs_conversion(df_series):
def _log_query(sql):
if log_query:
- log_query(engine.url, sql, schema, username, __name__)
+ log_query(engine.url, sql, schema, username, __name__,
security_manager)
with closing(engine.raw_connection()) as conn:
with closing(conn.cursor()) as cursor:
diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index 0c76c7cc16..5b3f927ac9 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -189,6 +189,7 @@ def handle_error(msg):
query.schema,
user_name,
__name__,
+ security_manager,
)
db_engine_spec.execute(cursor, query.executed_sql, async_=True)
logging.info('Handling cursor')
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]