Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update sendgrid with new models #1065

Merged
merged 1 commit into from
Nov 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@
from datetime import datetime
from typing import Generator

from airbyte_protocol import AirbyteCatalog, AirbyteConnectionStatus, AirbyteMessage, AirbyteRecordMessage, Status, Type
from airbyte_protocol import (
AirbyteCatalog,
AirbyteConnectionStatus,
AirbyteMessage,
AirbyteRecordMessage,
ConfiguredAirbyteCatalog,
Status,
Type,
)
from base_python import AirbyteLogger, ConfigContainer, Source
from python_http_client import ForbiddenError

Expand Down Expand Up @@ -58,10 +66,13 @@ def read(
) -> Generator[AirbyteMessage, None, None]:
client = self._client(config_container)

catalog = AirbyteCatalog.parse_obj(self.read_config(catalog_path))
config = self.read_config(catalog_path)
catalog = ConfiguredAirbyteCatalog.parse_obj(config)

logger.info("Starting syncing sendgrid")
for stream in catalog.streams:
for configured_stream in catalog.streams:
# TODO handle incremental syncs
stream = configured_stream.stream
if stream.name not in client.ENTITY_MAP.keys():
logger.warn(f"Stream '{stream}' not found in the recognized entities")
continue
Expand Down