mistercrunch commented on code in PR #31315:
URL: https://github.com/apache/superset/pull/31315#discussion_r1873671161
##########
superset/models/core.py:
##########
@@ -691,27 +731,30 @@ def _log_query(sql: str) -> None:
with self.get_raw_connection(catalog=catalog, schema=schema) as conn:
cursor = conn.cursor()
df = None
- for i, sql_ in enumerate(sqls):
- sql_ = self.mutate_sql_based_on_config(sql_, is_split=True)
- _log_query(sql_)
- with event_logger.log_context(
- action="execute_sql",
- database=self,
- object_ref=__name__,
- ):
- self.db_engine_spec.execute(cursor, sql_, self)
- if i < len(sqls) - 1:
- # If it's not the last, we don't keep the results
- cursor.fetchall()
- else:
- # Last query, fetch and process the results
- data = self.db_engine_spec.fetch_data(cursor)
- result_set = SupersetResultSet(
- data, cursor.description, self.db_engine_spec
- )
- df = result_set.to_pandas_df()
- if mutator:
- df = mutator(df)
+ with temporarily_disconnect_db():
+ if is_feature_enabled("SIMULATE_SLOW_ANALYTICS_DATABASE"):
+ time.sleep(30)
Review Comment:
Yeah I wanted it to be set as a value but also be dynamic (no need to deploy
to change). The feature flag framework we have now only accepts book, and
configs can't be changed on the fly...
I might just need to strip it out of this PR. Ideally we'd have a warm
configs/settings framework isolated from feature flags.
--
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]