Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik0 committed Jul 12, 2024
1 parent 18bc825 commit f532d3c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ class ClientSideIncrementalRecordFilterDecorator(RecordFilter):
"""

def __init__(
self, date_time_based_cursor: DatetimeBasedCursor, per_partition_cursor: Optional[PerPartitionCursor] = None,
is_global_parent_cursor: bool = False, **kwargs: Any
self,
date_time_based_cursor: DatetimeBasedCursor,
per_partition_cursor: Optional[PerPartitionCursor] = None,
is_global_parent_cursor: bool = False,
**kwargs: Any,
):
super().__init__(**kwargs)
self._date_time_based_cursor = date_time_based_cursor
Expand All @@ -59,7 +62,8 @@ def __init__(
@property
def _cursor_field(self) -> str:
return self._date_time_based_cursor.cursor_field.eval(
self._date_time_based_cursor.config) # type: ignore # eval returns a string in this context
self._date_time_based_cursor.config
) # type: ignore # eval returns a string in this context

@property
def _start_date_from_config(self) -> datetime.datetime:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from airbyte_cdk.sources.declarative.migrations.state_migration import StateMigration
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.

from typing import Any, Mapping

from airbyte_cdk.sources.declarative.migrations.state_migration import StateMigration


class IssuesChildStreamsStateMigration(StateMigration):
"""
Expand All @@ -21,6 +24,5 @@ def migrate(self, stream_state: Mapping[str, Any]) -> Mapping[str, Any]:
:param stream_state: The stream_state to migrate
:return: The migrated stream_state
"""
migrated_stream_state = {"state": {"updated": stream_state["updated"]},
"parent_state": {"issues": {"states": []}}}
migrated_stream_state = {"state": {"updated": stream_state["updated"]}, "parent_state": {"issues": {"states": []}}}
return migrated_stream_state
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import logging
import re
import urllib.parse as urlparse
from abc import ABC
Expand All @@ -10,7 +11,6 @@

import pendulum
import requests
import logging
from airbyte_cdk.sources import Source
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http import HttpStream
Expand All @@ -29,7 +29,9 @@ class JiraAvailabilityStrategy(HttpAvailabilityStrategy):
Inherit from HttpAvailabilityStrategy with slight modification to 403 and 401 error messages.
"""

def reasons_for_unavailable_status_codes(self, stream: Stream, logger: logging.Logger, source: Source, error: HTTPError) -> Dict[int, str]:
def reasons_for_unavailable_status_codes(
self, stream: Stream, logger: logging.Logger, source: Source, error: HTTPError
) -> Dict[int, str]:
reasons_for_codes: Dict[int, str] = {
requests.codes.FORBIDDEN: "Please check the 'READ' permission(Scopes for Connect apps) and/or the user has Jira Software rights and access.",
requests.codes.UNAUTHORIZED: "Invalid creds were provided, please check your api token, domain and/or email.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from airbyte_cdk.sources.declarative.migrations.state_migration import StateMigration
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.

from typing import Any, Mapping

from airbyte_cdk.sources.declarative.migrations.state_migration import StateMigration


class ThreadsStateMigration(StateMigration):
"""
Expand All @@ -21,6 +24,5 @@ def migrate(self, stream_state: Mapping[str, Any]) -> Mapping[str, Any]:
:param stream_state: The stream_state to migrate
:return: The migrated stream_state
"""
migrated_stream_state = {"state": {"ts": stream_state["float_ts"]},
"parent_state": {"channel_messages": {"states": []}}}
migrated_stream_state = {"state": {"ts": stream_state["float_ts"]}, "parent_state": {"channel_messages": {"states": []}}}
return migrated_stream_state

0 comments on commit f532d3c

Please sign in to comment.