Skip to content

Commit 19dbf7e

Browse files
committed
tell mypy to ignore lint errors
1 parent bfdee04 commit 19dbf7e

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

airbyte_cdk/connector_builder/connector_builder_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def should_migrate_manifest(config: Mapping[str, Any]) -> bool:
4848
4949
This flag is set by the UI.
5050
"""
51-
return config.get("__should_migrate", False)
51+
return config.get("__should_migrate", False) # type: ignore[no-any-return]
5252

5353

5454
def should_normalize_manifest(config: Mapping[str, Any]) -> bool:
@@ -57,7 +57,7 @@ def should_normalize_manifest(config: Mapping[str, Any]) -> bool:
5757
:param config: The configuration to check
5858
:return: True if the manifest should be normalized, False otherwise.
5959
"""
60-
return config.get("__should_normalize", False)
60+
return config.get("__should_normalize", False) # type: ignore[no-any-return]
6161

6262

6363
def create_source(

airbyte_cdk/manifest_server/command_processor/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2+
13
import copy
24
from typing import Any, Dict, List, Mapping, Optional
35

@@ -42,7 +44,7 @@ def should_migrate_manifest(manifest: Mapping[str, Any]) -> bool:
4244
4345
This flag is set by the UI.
4446
"""
45-
return manifest.get(SHOULD_MIGRATE_KEY, False)
47+
return bool(manifest.get(SHOULD_MIGRATE_KEY, False))
4648

4749

4850
def should_normalize_manifest(manifest: Mapping[str, Any]) -> bool:
@@ -52,7 +54,7 @@ def should_normalize_manifest(manifest: Mapping[str, Any]) -> bool:
5254
5355
This flag is set by the UI.
5456
"""
55-
return manifest.get(SHOULD_NORMALIZE_KEY, False)
57+
return bool(manifest.get(SHOULD_NORMALIZE_KEY, False))
5658

5759

5860
def build_source(

airbyte_cdk/sources/declarative/interpolation/macros.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from urllib.parse import quote_plus
1212

1313
import isodate
14-
import pytz
15-
from dateutil import parser
14+
import pytz # type: ignore[import-untyped]
15+
from dateutil import parser # type: ignore[import-untyped]
1616
from isodate import parse_duration
1717

1818
from airbyte_cdk.sources.declarative.datetime.datetime_parser import DatetimeParser
@@ -90,7 +90,7 @@ def str_to_datetime(s: str) -> datetime.datetime:
9090
if not parsed_date.tzinfo:
9191
# Assume UTC if the input does not contain a timezone
9292
parsed_date = parsed_date.replace(tzinfo=pytz.utc)
93-
return parsed_date.astimezone(pytz.utc)
93+
return parsed_date.astimezone(pytz.utc) # type: ignore[no-any-return]
9494

9595

9696
def max(*args: typing.Any) -> typing.Any:

airbyte_cdk/sources/file_based/stream/default_file_based_stream.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
NoReturn,
2020
Optional,
2121
Set,
22-
Tuple,
2322
Union,
2423
)
2524

@@ -93,7 +92,7 @@ def state(self, value: MutableMapping[str, Any]) -> None:
9392
def cursor(self) -> Optional[AbstractFileBasedCursor]:
9493
return self._cursor
9594

96-
@cursor.setter
95+
@cursor.setter # type: ignore[override]
9796
def cursor(self, value: AbstractFileBasedCursor) -> None:
9897
if self._cursor is not None:
9998
raise RuntimeError(

airbyte_cdk/sources/streams/checkpoint/checkpoint_reader.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,19 +247,19 @@ def next(self) -> Optional[Mapping[str, Any]]:
247247
try:
248248
self.current_slice = self._find_next_slice()
249249

250-
if "partition" in dict(self.current_slice):
250+
if "partition" in dict(self.current_slice): # type: ignore[arg-type]
251251
raise ValueError("Stream is configured to use invalid stream slice key 'partition'")
252-
elif "cursor_slice" in dict(self.current_slice):
252+
elif "cursor_slice" in dict(self.current_slice): # type: ignore[arg-type]
253253
raise ValueError(
254254
"Stream is configured to use invalid stream slice key 'cursor_slice'"
255255
)
256256

257257
# We convert StreamSlice to a regular mapping because legacy connectors operate on the basic Mapping object. We
258258
# also duplicate all fields at the top level for backwards compatibility for existing Python sources
259259
return {
260-
"partition": self.current_slice.partition,
261-
"cursor_slice": self.current_slice.cursor_slice,
262-
**dict(self.current_slice),
260+
"partition": self.current_slice.partition, # type: ignore[union-attr]
261+
"cursor_slice": self.current_slice.cursor_slice, # type: ignore[union-attr]
262+
**dict(self.current_slice), # type: ignore[arg-type]
263263
}
264264
except StopIteration:
265265
self._finished_sync = True

0 commit comments

Comments
 (0)