Skip to content

Commit

Permalink
airbyte-lib: Clean up test schema in Snowflake (#35015)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Reuter authored Feb 9, 2024
1 parent cf244b6 commit 600388e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions airbyte-lib/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from _pytest.nodes import Item
from google.cloud import secretmanager
from pytest_docker.plugin import get_docker_ip
from sqlalchemy import create_engine

from airbyte_lib.caches import PostgresCacheConfig

Expand Down Expand Up @@ -193,6 +194,10 @@ def snowflake_config():

yield config

engine = create_engine(config.get_sql_alchemy_url())
with engine.begin() as connection:
connection.execute(f"DROP SCHEMA IF EXISTS {config.schema_name}")


@pytest.fixture(autouse=True)
def source_test_registry(monkeypatch):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,6 @@ def test_sync_to_snowflake(snowflake_config: SnowflakeCacheConfig, expected_test

cache = SnowflakeSQLCache(config=snowflake_config)

with cache.get_sql_connection() as con:
con.execute("DROP SCHEMA IF EXISTS AIRBYTE_RAW")

result: ReadResult = source.read(cache)

assert result.processed_records == 3
Expand All @@ -693,6 +690,7 @@ def test_sync_to_snowflake(snowflake_config: SnowflakeCacheConfig, expected_test
check_dtype=False,
)


def test_sync_limited_streams(expected_test_stream_data):
source = ab.get_source("source-test", config={"apiKey": "test"})
cache = ab.new_local_cache()
Expand Down

0 comments on commit 600388e

Please sign in to comment.