Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Update snowflake-connector-python[pandas] requirement from ==2.4.* to…
Browse files Browse the repository at this point in the history
… >=2.4,<2.8 (#71)

* Update snowflake-connector-python[pandas] requirement

Updates the requirements on [snowflake-connector-python[pandas]](https://github.com/snowflakedb/snowflake-connector-python) to permit the latest version.
- [Release notes](https://github.com/snowflakedb/snowflake-connector-python/releases)
- [Commits](snowflakedb/snowflake-connector-python@v2.4.0...v2.7.0)

---
updated-dependencies:
- dependency-name: snowflake-connector-python[pandas]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update setup.py

* Update setup.py

* run tests for python 3.7, 3.8, and 3.9

* unique schema name for each python version test

* fix integration tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jeet Parekh <[email protected]>
Co-authored-by: Jeet Parekh <[email protected]>
  • Loading branch information
3 people authored Mar 1, 2022
1 parent bc8e8da commit 9ed9c2d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down
22 changes: 13 additions & 9 deletions tests/integration/test_tap_snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

LOGGER = singer.get_logger('tap_snowflake_tests')

SCHEMA_NAME = 'tap_snowflake_test'
SCHEMA_NAME = test_utils.SCHEMA_NAME

SINGER_MESSAGES = []

Expand Down Expand Up @@ -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"""
Expand All @@ -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"""
Expand All @@ -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'],
Expand Down
3 changes: 2 additions & 1 deletion tests/integration/utils.py
Original file line number Diff line number Diff line change
@@ -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():
Expand Down

0 comments on commit 9ed9c2d

Please sign in to comment.