|
1 | 1 | import requests |
2 | 2 |
|
3 | 3 | from .constants import ROW_FILTER_KEYS, ColumnTypes |
4 | | -from .constants import RENAME_COLUMN, RESIZE_COLUMN, FREEZE_COLUMN, MOVE_COLUMN, MODIFY_COLUMN_TYPE, DELETE_COLUMN |
5 | | -from .utils import convert_db_rows, parse_response, like_table_id, parse_headers |
| 4 | +from .constants import RENAME_COLUMN, RESIZE_COLUMN, FREEZE_COLUMN, MOVE_COLUMN, MODIFY_COLUMN_TYPE |
| 5 | +from .utils import parse_response, like_table_id |
6 | 6 |
|
7 | 7 |
|
8 | 8 | class APIGateway(object): |
@@ -809,17 +809,14 @@ def query(self, sql, convert=True, parameters=None): |
809 | 809 | json_data = {'sql': sql} |
810 | 810 | if parameters: |
811 | 811 | json_data['parameters'] = parameters |
| 812 | + if convert: |
| 813 | + json_data['convert_keys'] = True |
812 | 814 | response = requests.post(url, json=json_data, headers=self.headers, timeout=self.timeout) |
813 | 815 | data = parse_response(response) |
814 | 816 | if not data.get('success'): |
815 | 817 | raise Exception(data.get('error_message')) |
816 | | - metadata = data.get('metadata') |
817 | 818 | results = data.get('results') |
818 | | - if convert: |
819 | | - converted_results = convert_db_rows(metadata, results) |
820 | | - return converted_results |
821 | | - else: |
822 | | - return results |
| 819 | + return results |
823 | 820 |
|
824 | 821 | def send_toast_notification(self, username, msg, toast_type='success'): |
825 | 822 | url = self._send_toast_notification_url() |
|
0 commit comments