Пример #1
0
    def coerce_catalog_as_full_refresh(
            catalog: AirbyteCatalog) -> AirbyteCatalog:
        """
        Updates the sync mode on all streams in this catalog to be full refresh
        """
        coerced_catalog = catalog.copy()
        for stream in catalog.streams:
            stream.source_defined_cursor = False
            stream.supported_sync_modes = [SyncMode.full_refresh]
            stream.default_cursor_field = None

        # remove nulls
        return AirbyteCatalog.parse_raw(
            coerced_catalog.json(exclude_unset=True, exclude_none=True))
Пример #2
0
 def get_catalog(self) -> AirbyteCatalog:
     return AirbyteCatalog.parse_raw(
         pkgutil.get_data(
             self.__class__.__module__.split(".")[0],
             "catalog_subset.json"))