diff --git a/CHANGELOG.md b/CHANGELOG.md index b837966f..2b76d20a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. *The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).* +## [3.4.2] - 2022-06-14 +### Fixed +- Updated fetch_r_script_checksum method in the CLI to iterate over multiple results batches within a single cursor. This protects against failure in the case where the R-script results are large enough to require multiple batches. Ref snowflake-python-connector documentation here: https://docs.snowflake.com/en/user-guide/python-connector-api.html#get_result_batches + ## [3.4.1] - 2021-12-08 ### Added - Added a new optional parameter `--query-tag` to append a string to the QUERY_TAG that is attached to every SQL statement executed diff --git a/schemachange/cli.py b/schemachange/cli.py index a7b09603..a7dbe0f1 100644 --- a/schemachange/cli.py +++ b/schemachange/cli.py @@ -22,7 +22,7 @@ from cryptography.hazmat.primitives import serialization # Set a few global variables here -_schemachange_version = '3.4.1' +_schemachange_version = '3.4.2' _config_file_name = 'schemachange-config.yml' _metadata_database_name = 'METADATA' _metadata_schema_name = 'SCHEMACHANGE' @@ -614,9 +614,11 @@ def fetch_r_scripts_checksum(change_history_table, snowflake_session_parameters, script_names = [] checksums = [] for cursor in results: - for row in cursor: - script_names.append(row[0]) - checksums.append(row[1]) + batches = cursor.get_result_batches() + for batch in batches: + for row in batch: + script_names.append(row[0]) + checksums.append(row[1]) d_script_checksum['script_name'] = script_names d_script_checksum['checksum'] = checksums diff --git a/setup.cfg b/setup.cfg index d36df8d9..21dc5e7b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = schemachange -version = 3.4.1 +version = 3.4.2 author = jamesweakley/jeremiahhansen description = A Database Change Management tool for Snowflake long_description = file: README.md @@ -20,6 +20,7 @@ install_requires = pandas~=1.3 pyyaml~=5.4 jinja2~=3.0 + pyarrow>=6.0.0,<6.1.0 include_package_data = True [options.entry_points]