diff --git a/CHANGELOG.md b/CHANGELOG.md index 92105c709..55ea3605e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,6 @@ # Release History -## 2.9.4 (Unreleased) - -## 2.9.4b1 (2024-02-16) +## 2.9.4 (2024-02-20) - Fix: Cloud fetch file download errors (#356) - Fix: Redact the URL query parameters from the urllib3.connectionpool logs (#341) diff --git a/pyproject.toml b/pyproject.toml index d73e7d101..66abe1aa1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "databricks-sql-connector" -version = "2.9.4b1" +version = "2.9.4" description = "Databricks SQL Connector for Python" authors = ["Databricks "] license = "Apache-2.0" diff --git a/src/databricks/sql/__init__.py b/src/databricks/sql/__init__.py index b9ee38539..58eedb17e 100644 --- a/src/databricks/sql/__init__.py +++ b/src/databricks/sql/__init__.py @@ -60,7 +60,7 @@ def __repr__(self): DATE = DBAPITypeObject("date") ROWID = DBAPITypeObject() -__version__ = "2.9.4b1" +__version__ = "2.9.4" USER_AGENT_NAME = "PyDatabricksSqlConnector" # These two functions are pyhive legacy diff --git a/src/databricks/sql/cloudfetch/downloader.py b/src/databricks/sql/cloudfetch/downloader.py index acfe0bc20..35684d53d 100644 --- a/src/databricks/sql/cloudfetch/downloader.py +++ b/src/databricks/sql/cloudfetch/downloader.py @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) -DEFAULT_CLOUD_FILE_TIMEOUT = int(os.getenv("DATABRICKS_CLOUD_FILE_TIMEOUT", 60)) +DEFAULT_CLOUD_FILE_TIMEOUT = int(os.getenv("DATABRICKS_CLOUD_FILE_TIMEOUT", 180)) @dataclass @@ -221,7 +221,7 @@ def http_get_with_retry(url, max_retries=5, backoff_factor=2, download_timeout=6 return response else: logger.error(response) - except requests.RequestException as e: + except Exception as e: # if this is not redacted, it will print the pre-signed URL logger.error(f"request failed with exception: {re.sub(pattern, mask, str(e))}") finally: diff --git a/src/databricks/sql/utils.py b/src/databricks/sql/utils.py index 60fba1f7e..8aec34d9e 100644 --- a/src/databricks/sql/utils.py +++ b/src/databricks/sql/utils.py @@ -226,6 +226,9 @@ def _create_next_table(self) -> Union[pyarrow.Table, None]: # The server rarely prepares the exact number of rows requested by the client in cloud fetch. # Subsequently, we drop the extraneous rows in the last file if more rows are retrieved than requested if arrow_table.num_rows > downloaded_file.row_count: + logger.debug( + f"received {arrow_table.num_rows} rows, expected {downloaded_file.row_count} rows. Dropping extraneous rows." + ) self.start_row_index += downloaded_file.row_count return arrow_table.slice(0, downloaded_file.row_count)