diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9353294..2259193 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.6, 3.7, 3.8 ] + python-version: [ 3.6, 3.7, 3.8, 3.9 ] steps: - name: Checkout repository @@ -38,7 +38,7 @@ jobs: environment: ci_tests strategy: matrix: - python-version: [ 3.8 ] + python-version: [ 3.7, 3.8, 3.9 ] concurrency: group: integration_tests-${{ github.head_ref }} cancel-in-progress: true diff --git a/setup.py b/setup.py index 948e499..361fb2e 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ py_modules=['tap_snowflake'], install_requires=[ 'pipelinewise-singer-python==1.*', - 'snowflake-connector-python[pandas]==2.4.*', + 'snowflake-connector-python[pandas]==2.7.*', 'pendulum==1.2.0' ], extras_require={ diff --git a/tests/integration/test_tap_snowflake.py b/tests/integration/test_tap_snowflake.py index e3dc12c..c195403 100644 --- a/tests/integration/test_tap_snowflake.py +++ b/tests/integration/test_tap_snowflake.py @@ -16,7 +16,7 @@ LOGGER = singer.get_logger('tap_snowflake_tests') -SCHEMA_NAME = 'tap_snowflake_test' +SCHEMA_NAME = test_utils.SCHEMA_NAME SINGER_MESSAGES = [] @@ -111,10 +111,14 @@ def test_discover_catalog_with_multiple_table(self): # Three tables should be discovered tap_stream_ids = [s.tap_stream_id for s in catalog.streams] - self.assertCountEqual(tap_stream_ids, - [f'{self.config["dbname"]}-TAP_SNOWFLAKE_TEST-EMPTY_TABLE_1', - f'{self.config["dbname"]}-TAP_SNOWFLAKE_TEST-EMPTY_TABLE_2', - f'{self.config["dbname"]}-TAP_SNOWFLAKE_TEST-TEST_TYPE_MAPPING']) + + expected_tap_stream_ids = [ + f'{self.config["dbname"]}-{SCHEMA_NAME}-EMPTY_TABLE_1', + f'{self.config["dbname"]}-{SCHEMA_NAME}-EMPTY_TABLE_2', + f'{self.config["dbname"]}-{SCHEMA_NAME}-TEST_TYPE_MAPPING' + ] + + self.assertCountEqual(tap_stream_ids, expected_tap_stream_ids) def test_discover_catalog_with_single_table(self): """Validate if discovering catalog with filter_tables option working as expected""" @@ -124,8 +128,8 @@ def test_discover_catalog_with_single_table(self): # Only one table should be discovered tap_stream_ids = [s.tap_stream_id for s in catalog.streams] - self.assertCountEqual(tap_stream_ids, - [f'{self.config["dbname"]}-TAP_SNOWFLAKE_TEST-EMPTY_TABLE_2']) + expected_tap_stream_ids = [f'{self.config["dbname"]}-{SCHEMA_NAME}-EMPTY_TABLE_2'] + self.assertCountEqual(tap_stream_ids, expected_tap_stream_ids) def test_discover_catalog_with_not_existing_table(self): """Validate if discovering catalog raises as exception when table not exist""" @@ -142,8 +146,8 @@ def test_discover_catalog_with_view(self): # Only one view should be discovered tap_stream_ids = [s.tap_stream_id for s in catalog.streams] - self.assertCountEqual(tap_stream_ids, - [f'{self.config["dbname"]}-TAP_SNOWFLAKE_TEST-EMPTY_VIEW_1']) + expected_tap_stream_ids = [f'{self.config["dbname"]}-{SCHEMA_NAME}-EMPTY_VIEW_1'] + self.assertCountEqual(tap_stream_ids, expected_tap_stream_ids) def test_decimal(self): self.assertEqual(self.dt_schema.properties['C_DECIMAL'], diff --git a/tests/integration/utils.py b/tests/integration/utils.py index 0d71474..e7573aa 100644 --- a/tests/integration/utils.py +++ b/tests/integration/utils.py @@ -1,11 +1,12 @@ import os +from sys import version_info as py_version import singer import tap_snowflake from tap_snowflake.connection import SnowflakeConnection -SCHEMA_NAME='tap_snowflake_test' +SCHEMA_NAME = f'TAP_SNOWFLAKE_TEST_PY{py_version.major}_{py_version.minor}' def get_db_config():