Skip to content

Commit

Permalink
Tweak test requirements (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
genzgd authored Sep 10, 2022
1 parent 1e22ebc commit da0351b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

* In the next minor release (0.3.0) the row_binary option for ClickHouse serialization will be removed. The performance is significantly lower than Native format and maintaining the option adds complexity with no corresponding benefit

### Release 0.2.7 2022-09-10

#### Improvement
* The HTTP client now raises an OperationalError instead of a DatabaseError when the HTTP status code is 429 (too many requests), 503 (service unavailable), or 504 (gateway timeout) to make it easier to determine if it is a retryable exception

### Release 0.2.6 2022-09-08

Expand Down
2 changes: 1 addition & 1 deletion clickhouse_connect/driver/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def raw_insert(self, table: str,
fmt: Optional[str] = None):
"""
Insert data already formatted in a bytes object
:param table: Table name (whether or not qualified with the database name
:param table: Table name (whether qualified with the database name or not)
:param column_names: Sequence of column names
:param insert_block: Binary or string data already in a recognized ClickHouse format
:param settings: Optional dictionary of ClickHouse settings (key/string values)
Expand Down
4 changes: 3 additions & 1 deletion clickhouse_connect/driver/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ def _raw_request(self,
err_msg = response.content.decode(errors='backslashreplace')
logger.error(str(err_msg))
err_str = f':{err_str}\n {err_msg[0:240]}'
if attempts > retries or response.status_code not in (429, 503, 504):
if response.status_code not in (429, 503, 504):
raise DatabaseError(err_str)
if attempts > retries:
raise OperationalError(err_str)

def ping(self):
"""
Expand Down

0 comments on commit da0351b

Please sign in to comment.