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

⏱️ [Do not merge]: Replace mypy type checking with pyright #208

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
fix mypy
aaronsteers committed Apr 24, 2024
commit 5297ad7adfd69662d631b983af57af6e8a83bae6
6 changes: 4 additions & 2 deletions airbyte/caches/base.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

import abc
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional, cast, final
from typing import TYPE_CHECKING, Any, Generator, Optional, cast, final

from pydantic import BaseModel, PrivateAttr

@@ -125,5 +125,7 @@ def __getitem__(self, stream: str) -> DatasetBase:
def __contains__(self, stream: str) -> bool:
return stream in (self.processor.expected_streams)

def __iter__(self) -> Iterator[tuple[str, Any]]:
def __iter__( # type: ignore [override] # Overrides Pydantic BaseModel return type
self,
) -> Iterator[tuple[str, Any]]:
return ((name, dataset) for name, dataset in self.streams.items())
2 changes: 1 addition & 1 deletion examples/run_integ_test_source.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ def get_secret_name(connector_name: str) -> str:

def main(
connector_name: str,
secret_name: str | None,
secret_name: str,
streams: list[str] | None,
) -> None:
secret = secret_mgr.get_secret(
2 changes: 1 addition & 1 deletion examples/run_test_source_single_stream.py
Original file line number Diff line number Diff line change
@@ -17,4 +17,4 @@

source = ab.get_source("source-test", config={"apiKey": "test"})

print(list(source.read_stream("stream1")))
print(list(source.read(streams=["stream1"])))
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -80,7 +80,6 @@ markers = [
target-version = "py39"
preview = true
line-length = 100
# extend-exclude = ["docs", "test", "tests"]

[tool.ruff.lint]
select = [
@@ -264,7 +263,12 @@ strict_equality = true
show_error_context = false
show_column_numbers = false
show_error_codes = true
# exclude = ["docs", "test", "tests"]
exclude = [
"tests/integration_tests/fixtures/source-broken",
"tests/integration_tests/fixtures/source-test",
"docs",
"tests",
]

[[tool.mypy.overrides]]
module = ["airbyte_protocol", "airbyte_protocol.models"]