diff --git a/examples/run_faker_to_motherduck.py b/examples/run_faker_to_motherduck.py index 6fa024f9..aecee90a 100644 --- a/examples/run_faker_to_motherduck.py +++ b/examples/run_faker_to_motherduck.py @@ -35,7 +35,7 @@ api_key=MOTHERDUCK_API_KEY, ) -result = source.read(cache=cache) +result = source.read(cache=cache, force_full_refresh=True) for name, records in result.streams.items(): print(f"Stream {name}: {len(records)} records") diff --git a/examples/run_snowflake_faker.py b/examples/run_snowflake_faker.py index d0ea5910..3e5f7b8f 100644 --- a/examples/run_snowflake_faker.py +++ b/examples/run_snowflake_faker.py @@ -1,4 +1,10 @@ # Copyright (c) 2023 Airbyte, Inc., all rights reserved. +""" +Usage: + poetry install + poetry run python examples/run_snowflake_faker.py +""" + from __future__ import annotations import airbyte as ab diff --git a/tests/integration_tests/test_all_cache_types.py b/tests/integration_tests/test_all_cache_types.py index 9d536798..5b6f8f46 100644 --- a/tests/integration_tests/test_all_cache_types.py +++ b/tests/integration_tests/test_all_cache_types.py @@ -15,7 +15,7 @@ import airbyte as ab from airbyte._executor import _get_bin_dir -from airbyte.progress import progress +from airbyte.progress import progress, ReadProgress # Product count is always the same, regardless of faker scale. @@ -121,7 +121,7 @@ def test_pokeapi_read( @pytest.fixture(scope="function") def progress_mock( mocker: pytest.MockerFixture, -) -> ab.ReadProgress: +) -> ReadProgress: """Fixture to return a mocked version of progress.progress.""" # Mock the progress object. mocker.spy(progress, 'reset') @@ -142,7 +142,7 @@ def progress_mock( def test_faker_read( source_faker_seed_a: ab.Source, new_generic_cache: ab.caches.CacheBase, - progress_mock: ab.ReadProgress, + progress_mock: ReadProgress, ) -> None: """Test that the append strategy works as expected.""" result = source_faker_seed_a.read( @@ -165,6 +165,10 @@ def test_faker_read( assert progress_mock.log_stream_finalized.call_count == 1 assert progress_mock.log_success.call_count == 1 + status_msg: str = progress_mock._get_status_message() + assert "Read **0** records" not in status_msg + assert f"Read **{configured_count}** records" in status_msg + assert len(list(result.cache.streams["users"])) == FAKER_SCALE_A