Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfu0 committed Sep 24, 2022
1 parent 3d8c86b commit 66402ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 5 additions & 6 deletions redash/query_runner/pinot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

class Pinot(BaseQueryRunner):
noop_query = "SELECT 1"
controller_uri = "http://localhost:9000"
username = None
password = None

Expand All @@ -38,10 +37,10 @@ def configuration_schema(cls):
return {
"type": "object",
"properties": {
"brokerHost": {"type": "string", "default": "localhost"},
"brokerHost": {"type": "string", "default": ""},
"brokerPort": {"type": "number", "default": 8099},
"brokerScheme": {"type": "string", "default": "http"},
"controllerURI": {"type": "string", "default": "http://localhost:9000"},
"controllerURI": {"type": "string", "default": ""},
"username": {"type": "string"},
"password": {"type": "string"},
},
Expand Down Expand Up @@ -87,7 +86,7 @@ def run_query(self, query, user):
data = {"columns": columns, "rows": rows}
error = None
json_data = json_dumps(data)
logger.debug("Pinot execute query [%s], and resp: %s", query, json_data)
logger.debug("Pinot execute query [%s]", query)
finally:
connection.close()

Expand Down Expand Up @@ -125,10 +124,10 @@ def get_metadata_from_controller(self, path):
r = requests.get(url, headers={"Accept": "application/json"}, auth= HTTPBasicAuth(self.username, self.password))
try:
result = r.json()
logger.debug("get_metadata_from_controller from path %s: %s", path, result)
logger.debug("get_metadata_from_controller from path %s", path)
except ValueError as e:
raise pinotdb.exceptions.DatabaseError(
"Got invalid json response from " f"{self.controller_uri}:{path}: {r.text}"
f"Got invalid json response from {self.controller_uri}:{path}: {r.text}"
) from e
return result

Expand Down
4 changes: 1 addition & 3 deletions requirements_all_ds.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ pandas==1.3.4
nzpy>=1.15
nzalchemy
python-arango==6.1.0
pinotdb>=0.4.1
httpx==0.23.0
six==1.11.0
pinotdb>=0.4.5

0 comments on commit 66402ca

Please sign in to comment.