1
0
mirror of synced 2025-12-26 05:05:18 -05:00
Files
airbyte/airbyte-cdk/python/unit_tests/connector_builder/utils.py

28 lines
820 B
Python

#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from typing import Any, Mapping
from airbyte_cdk.models import ConfiguredAirbyteCatalog, ConfiguredAirbyteCatalogSerializer
def create_configured_catalog_dict(stream_name: str) -> Mapping[str, Any]:
return {
"streams": [
{
"stream": {
"name": stream_name,
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
},
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite",
}
]
}
def create_configured_catalog(stream_name: str) -> ConfiguredAirbyteCatalog:
return ConfiguredAirbyteCatalogSerializer.load(create_configured_catalog_dict(stream_name))