mirror of
https://github.com/getredash/redash.git
synced 2026-03-22 01:00:14 -04:00
fix: Make sure boto installed (#4835)
Signed-off-by: koooge <koooooge@gmail.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
import boto3
|
||||
import yaml
|
||||
import datetime
|
||||
|
||||
from redash.query_runner import BaseQueryRunner, register
|
||||
from redash.utils import json_dumps, parse_human_time
|
||||
|
||||
try:
|
||||
import boto3
|
||||
enabled = True
|
||||
except ImportError:
|
||||
enabled = False
|
||||
|
||||
def parse_response(results):
|
||||
columns = [
|
||||
@@ -63,6 +67,10 @@ class CloudWatch(BaseQueryRunner):
|
||||
"secret": ["aws_secret_key"],
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def enabled(cls):
|
||||
return enabled
|
||||
|
||||
def __init__(self, configuration):
|
||||
super(CloudWatch, self).__init__(configuration)
|
||||
self.syntax = "yaml"
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
import boto3
|
||||
import yaml
|
||||
import datetime
|
||||
import time
|
||||
|
||||
from botocore.exceptions import ParamValidationError
|
||||
|
||||
from redash.query_runner import BaseQueryRunner, register
|
||||
from redash.utils import json_dumps, parse_human_time
|
||||
|
||||
try:
|
||||
import boto3
|
||||
from botocore.exceptions import ParamValidationError
|
||||
enabled = True
|
||||
except ImportError:
|
||||
enabled = False
|
||||
|
||||
POLL_INTERVAL = 3
|
||||
TIMEOUT = 180
|
||||
|
||||
@@ -81,6 +85,10 @@ class CloudWatchInsights(BaseQueryRunner):
|
||||
"secret": ["aws_secret_key"],
|
||||
}
|
||||
|
||||
@classmethod
|
||||
def enabled(cls):
|
||||
return enabled
|
||||
|
||||
def __init__(self, configuration):
|
||||
super(CloudWatchInsights, self).__init__(configuration)
|
||||
self.syntax = "yaml"
|
||||
|
||||
Reference in New Issue
Block a user