Skip to content

Commit

Permalink
chore: auto-fix lint and format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
octavia-squidington-iii committed Jan 9, 2025
1 parent 18f17f3 commit 9246eed
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@

import pendulum
import requests
from requests.exceptions import InvalidURL
from isodate import Duration, parse_duration
from requests.exceptions import InvalidURL

from airbyte_cdk.models import FailureType
from airbyte_cdk.sources.declarative.extractors.record_extractor import RecordExtractor
from airbyte_cdk.sources.declarative.incremental import CursorFactory, DatetimeBasedCursor, PerPartitionCursor
from airbyte_cdk.sources.declarative.interpolation import InterpolatedString
from airbyte_cdk.sources.declarative.partition_routers import CartesianProductStreamSlicer
from airbyte_cdk.sources.declarative.partition_routers.single_partition_router import SinglePartitionRouter
from airbyte_cdk.sources.declarative.requesters import HttpRequester
from airbyte_cdk.sources.declarative.requesters.error_handlers import DefaultErrorHandler
from airbyte_cdk.sources.declarative.requesters.request_options.interpolated_request_options_provider import (
InterpolatedRequestOptionsProvider,
RequestInput,
Expand All @@ -32,11 +34,9 @@
from airbyte_cdk.sources.declarative.types import Config, Record, StreamSlice, StreamState
from airbyte_cdk.sources.streams.core import StreamData
from airbyte_cdk.sources.streams.http import HttpClient
from airbyte_cdk.sources.streams.http.error_handlers import ErrorResolution, ResponseAction
from airbyte_cdk.sources.streams.http.exceptions import DefaultBackoffException, RequestBodyException, UserDefinedBackoffException
from airbyte_cdk.sources.streams.http.http import BODY_REQUEST_METHODS
from airbyte_cdk.models import FailureType
from airbyte_cdk.sources.declarative.requesters.error_handlers import DefaultErrorHandler
from airbyte_cdk.sources.streams.http.error_handlers import ErrorResolution, ResponseAction

from .utils import ANALYTICS_FIELDS_V2, FIELDS_CHUNK_SIZE, transform_data

Expand Down Expand Up @@ -295,6 +295,8 @@ def _apply_transformations(self):

if transformations:
self.record_selector.transformations = transformations


@dataclass
class LinkedInAdsErrorHandler(DefaultErrorHandler):
"""
Expand All @@ -312,4 +314,4 @@ def interpret_response(self, response_or_exception: Optional[Union[requests.Resp
failure_type=FailureType.transient_error,
error_message="source-linkedin-ads has faced a temporary DNS resolution issue. Retrying...",
)
return super().interpret_response(response_or_exception)
return super().interpret_response(response_or_exception)
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -79,7 +79,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -145,7 +145,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -217,7 +217,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -279,7 +279,7 @@ definitions:
q: criteria
request_headers:
Linkedin-Version: "202404"
X-RestLi-Method: FINDER
X-RestLi-Method: FINDER
error_handlers:
type: CompositeErrorHandler
error_handlers:
Expand Down Expand Up @@ -307,7 +307,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -376,7 +376,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
extractor:
Expand Down Expand Up @@ -450,7 +450,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -531,7 +531,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -612,7 +612,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -693,7 +693,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -774,7 +774,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -855,7 +855,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -936,7 +936,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -1017,7 +1017,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -1098,7 +1098,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -1179,7 +1179,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -1260,7 +1260,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down Expand Up @@ -1342,7 +1342,7 @@ definitions:
class_name: "source_linkedin_ads.components.LinkedInAdsErrorHandler"
backoff_strategies:
- type: ExponentialBackoffStrategy
factor: 5
factor: 5
record_selector:
type: RecordSelector
$parameters:
Expand Down

0 comments on commit 9246eed

Please sign in to comment.