Skip to content

Commit

Permalink
fix: Make sure boto installed (#4835)
Browse files Browse the repository at this point in the history
Signed-off-by: koooge <[email protected]>
  • Loading branch information
koooge authored Apr 25, 2020
1 parent 60f92a2 commit de6d665
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
10 changes: 9 additions & 1 deletion redash/query_runner/cloudwatch.py
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down Expand Up @@ -63,6 +67,10 @@ def configuration_schema(cls):
"secret": ["aws_secret_key"],
}

@classmethod
def enabled(cls):
return enabled

def __init__(self, configuration):
super(CloudWatch, self).__init__(configuration)
self.syntax = "yaml"
Expand Down
14 changes: 11 additions & 3 deletions redash/query_runner/cloudwatch_insights.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -81,6 +85,10 @@ def configuration_schema(cls):
"secret": ["aws_secret_key"],
}

@classmethod
def enabled(cls):
return enabled

def __init__(self, configuration):
super(CloudWatchInsights, self).__init__(configuration)
self.syntax = "yaml"
Expand Down

0 comments on commit de6d665

Please sign in to comment.