1
0
mirror of synced 2026-01-17 03:06:35 -05:00

Run MyPy on CDK/base-python and fix issues. (#3175)

This commit is contained in:
Davin Chia
2021-05-04 11:02:53 +08:00
committed by GitHub
parent dd45537239
commit 72e7fe35a3
11 changed files with 54 additions and 45 deletions

View File

@@ -23,7 +23,7 @@
import copy
from datetime import datetime
from typing import Any, Iterator, Mapping, MutableMapping, Type
from typing import Any, Iterable, Mapping, MutableMapping, Type
from airbyte_cdk.models import (
AirbyteCatalog,
@@ -46,7 +46,7 @@ from .logger import AirbyteLogger
class BaseSource(Source):
"""Base source that designed to work with clients derived from BaseClient"""
client_class: Type[BaseClient] = None
client_class: Type[BaseClient]
@property
def name(self) -> str:
@@ -55,9 +55,7 @@ class BaseSource(Source):
def _get_client(self, config: Mapping):
"""Construct client"""
client = self.client_class(**config)
return client
return self.client_class(**config)
def discover(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> AirbyteCatalog:
"""Discover streams"""
@@ -76,7 +74,7 @@ class BaseSource(Source):
def read(
self, logger: AirbyteLogger, config: Mapping[str, Any], catalog: ConfiguredAirbyteCatalog, state: MutableMapping[str, Any] = None
) -> Iterator[AirbyteMessage]:
) -> Iterable[AirbyteMessage]:
state = state or {}
client = self._get_client(config)