diff --git a/integration_tests/fixtures.py b/integration_tests/fixtures.py index d1cc407..9142035 100644 --- a/integration_tests/fixtures.py +++ b/integration_tests/fixtures.py @@ -133,7 +133,7 @@ def wait_for_presto_coordinator(stream, timeout=30): time.sleep(5) return True if time.time() - t0 > timeout: - logger.error("coordinator took longer than {} to start".format(timeout)) + logger.error("coordinator took longer than %s to start", timeout) raise TimeoutError return False diff --git a/prestodb/__init__.py b/prestodb/__init__.py index a209710..b620d16 100644 --- a/prestodb/__init__.py +++ b/prestodb/__init__.py @@ -20,4 +20,4 @@ from . import exceptions from . import logging -__version__ = "0.8.2" +__version__ = "0.8.3" diff --git a/prestodb/client.py b/prestodb/client.py index c1cea7a..666451b 100644 --- a/prestodb/client.py +++ b/prestodb/client.py @@ -359,10 +359,8 @@ def post(self, sql): while http_response is not None and http_response.is_redirect: location = http_response.headers["Location"] url = self._redirect_handler.handle(location) - logger.info( - "redirect {} from {} to {}".format( + logger.info("redirect % from % to %", http_response.status_code, location, url - ) ) http_response = self._post( url, @@ -412,7 +410,7 @@ def process(self, http_response): http_response.encoding = "utf-8" response = http_response.json() - logger.debug("HTTP {}: {}".format(http_response.status_code, response)) + logger.debug("HTTP %s: %s", http_response.status_code, response) if "error" in response: raise self._process_error(response["error"], response.get("id")) @@ -482,7 +480,7 @@ def __iter__(self): rows = self._query.fetch() for row in rows: self._rownumber += 1 - logger.debug("row {}".format(row)) + logger.debug("row %s", row) yield row diff --git a/prestodb/exceptions.py b/prestodb/exceptions.py index 198f54e..5308cd2 100644 --- a/prestodb/exceptions.py +++ b/prestodb/exceptions.py @@ -126,7 +126,7 @@ def decorated(*args, **kwargs): handle_retry.retry(func, args, kwargs, err, attempt) continue break - logger.info("failed after {} attempts".format(attempt)) + logger.info("failed after %s attempts", attempt) if error is not None: raise error return result diff --git a/prestodb/transaction.py b/prestodb/transaction.py index 43a4b51..c1973a8 100644 --- a/prestodb/transaction.py +++ b/prestodb/transaction.py @@ -76,7 +76,7 @@ def begin(self): self._id = response.headers[constants.HEADER_STARTED_TRANSACTION] status = self._request.process(response) self._request.transaction_id = self._id - logger.info("transaction started: " + self._id) + logger.info("transaction started: %s", self._id) def commit(self): query = prestodb.client.PrestoQuery(self._request, COMMIT)