Skip to content

Commit

Permalink
fix: W0707
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreSilveiraAzion committed Aug 6, 2024
1 parent 6d1c973 commit 3d0f495
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions edgesql.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def execute(self, buffer):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code == HTTPStatus.OK:
result_data = json_data.get('data', [])
Expand Down Expand Up @@ -144,7 +144,7 @@ def list_databases(self):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code == HTTPStatus.OK: # 200
databases = json_data.get('results')
Expand Down Expand Up @@ -180,7 +180,7 @@ def set_current_database(self, database_name):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code == HTTPStatus.OK: # 200
databases = json_data.get('results')
Expand Down Expand Up @@ -214,7 +214,7 @@ def get_database_id(self, database_name):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code == HTTPStatus.OK: # 200
databases = json_data.get('results',[])
Expand Down Expand Up @@ -248,7 +248,7 @@ def get_database_info(self):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code == HTTPStatus.OK: # 200
data = json_data.get('data')
Expand Down Expand Up @@ -314,7 +314,7 @@ def create_database(self, database_name):
try:
json_data = response.json()
except json.JSONDecodeError as e:
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}")
raise ValueError(f"Error decoding JSON response: {e}. statusCode={response.status_code}") from e

if response.status_code in [HTTPStatus.ACCEPTED, HTTPStatus.CREATED]: # 201/202
data = json_data.get('data')
Expand Down

0 comments on commit 3d0f495

Please sign in to comment.