From e9ba331be5c889ac6edf689311b4767dc2b989e0 Mon Sep 17 00:00:00 2001 From: mirkan-ubuntu-wsl Date: Mon, 31 Mar 2025 12:14:09 +0300 Subject: [PATCH 1/2] Remove unnecessary global declarations in destination and query runner registration --- redash/destinations/__init__.py | 2 -- redash/query_runner/__init__.py | 2 -- 2 files changed, 4 deletions(-) diff --git a/redash/destinations/__init__.py b/redash/destinations/__init__.py index 4a24e99103..9cb6d50ac5 100644 --- a/redash/destinations/__init__.py +++ b/redash/destinations/__init__.py @@ -47,9 +47,7 @@ def to_dict(cls): destinations = {} - def register(destination_class): - global destinations if destination_class.enabled(): logger.debug( "Registering %s (%s) destinations.", diff --git a/redash/query_runner/__init__.py b/redash/query_runner/__init__.py index 10d6d6edf5..46a75610b8 100644 --- a/redash/query_runner/__init__.py +++ b/redash/query_runner/__init__.py @@ -407,9 +407,7 @@ def get_response(self, url, auth=None, http_method="get", **kwargs): query_runners = {} - def register(query_runner_class): - global query_runners if query_runner_class.enabled(): logger.debug( "Registering %s (%s) query runner.", From 83a1152bbeded669992859c0dd259fd46f28c641 Mon Sep 17 00:00:00 2001 From: mirkan-ubuntu-wsl Date: Thu, 1 May 2025 16:21:29 +0300 Subject: [PATCH 2/2] Add blank lines for improved readability in destination and query runner registration --- redash/destinations/__init__.py | 1 + redash/query_runner/__init__.py | 1 + 2 files changed, 2 insertions(+) diff --git a/redash/destinations/__init__.py b/redash/destinations/__init__.py index 9cb6d50ac5..f59213d7b7 100644 --- a/redash/destinations/__init__.py +++ b/redash/destinations/__init__.py @@ -47,6 +47,7 @@ def to_dict(cls): destinations = {} + def register(destination_class): if destination_class.enabled(): logger.debug( diff --git a/redash/query_runner/__init__.py b/redash/query_runner/__init__.py index 46a75610b8..8f6f9deca5 100644 --- a/redash/query_runner/__init__.py +++ b/redash/query_runner/__init__.py @@ -407,6 +407,7 @@ def get_response(self, url, auth=None, http_method="get", **kwargs): query_runners = {} + def register(query_runner_class): if query_runner_class.enabled(): logger.debug(