Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik0 committed Feb 15, 2024
1 parent 77c2672 commit ad7bcf4
Show file tree
Hide file tree
Showing 22 changed files with 25 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import json

import pytest

from source_facebook_marketing.config_migrations import MigrateAccountIdToArray


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@
from typing import Any, List, MutableMapping, Set, Tuple

import pytest
from airbyte_cdk.models import (
AirbyteMessage,
ConfiguredAirbyteCatalog,
ConfiguredAirbyteStream,
DestinationSyncMode,
SyncMode,
Type,
)

from airbyte_cdk.models import AirbyteMessage, ConfiguredAirbyteCatalog, ConfiguredAirbyteStream, DestinationSyncMode, SyncMode, Type
from source_facebook_marketing.source import SourceFacebookMarketing


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.api import FacebookResponse
from facebook_business.exceptions import FacebookRequestError

from source_facebook_marketing.streams.common import retry_pattern

logger = logging.getLogger("airbyte")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.utils import AirbyteTracedException

from source_facebook_marketing.api import API
from source_facebook_marketing.spec import ConnectorConfig
from source_facebook_marketing.streams import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
from facebook_business.adobjects.adset import AdSet
from facebook_business.adobjects.campaign import Campaign
from facebook_business.adobjects.objectparser import ObjectParser
from facebook_business.api import (
FacebookAdsApi,
FacebookAdsApiBatch,
FacebookBadObjectError,
FacebookResponse,
)
from facebook_business.api import FacebookAdsApi, FacebookAdsApiBatch, FacebookBadObjectError, FacebookResponse
from pendulum.duration import Duration

from source_facebook_marketing.streams.common import retry_pattern

from ..utils import validate_start_date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@
#

import logging
from typing import (
Any,
Iterable,
Iterator,
List,
Mapping,
MutableMapping,
Optional,
Union,
)
from typing import Any, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Union

import airbyte_cdk.sources.utils.casing as casing
import pendulum
Expand All @@ -21,7 +12,6 @@
from airbyte_cdk.sources.utils.schema_helpers import ResourceSchemaLoader
from airbyte_cdk.utils import AirbyteTracedException
from facebook_business.exceptions import FacebookBadObjectError, FacebookRequestError

from source_facebook_marketing.streams.async_job import AsyncJob, InsightAsyncJob
from source_facebook_marketing.streams.async_job_manager import InsightAsyncJobManager
from source_facebook_marketing.streams.common import traced_exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
from facebook_business.adobjects.abstractobject import AbstractObject
from facebook_business.exceptions import FacebookRequestError

from source_facebook_marketing.streams.common import traced_exception

from .common import deep_merge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,10 @@
from facebook_business.adobjects.adimage import AdImage
from facebook_business.adobjects.user import User
from facebook_business.exceptions import FacebookRequestError

from source_facebook_marketing.spec import (
ValidAdSetStatuses,
ValidAdStatuses,
ValidCampaignStatuses,
)
from source_facebook_marketing.spec import ValidAdSetStatuses, ValidAdStatuses, ValidCampaignStatuses

from .base_insight_streams import AdsInsights
from .base_streams import (
FBMarketingIncrementalStream,
FBMarketingReversedIncrementalStream,
FBMarketingStream,
)
from .base_streams import FBMarketingIncrementalStream, FBMarketingReversedIncrementalStream, FBMarketingStream

logger = logging.getLogger("airbyte")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pendulum
from facebook_business import FacebookAdsApi, FacebookSession
from pytest import fixture

from source_facebook_marketing.api import API

FB_API_VERSION = FacebookAdsApi.API_VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

import pendulum
import pytest
import source_facebook_marketing
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.adobjects.adaccount import AdAccount

import source_facebook_marketing

FB_API_VERSION = FacebookAdsApi.API_VERSION


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@
from facebook_business.adobjects.adsinsights import AdsInsights
from facebook_business.adobjects.campaign import Campaign
from facebook_business.api import FacebookAdsApiBatch, FacebookBadObjectError

from source_facebook_marketing.api import MyFacebookAdsApi
from source_facebook_marketing.streams.async_job import (
InsightAsyncJob,
ParentAsyncJob,
Status,
update_in_batch,
)
from source_facebook_marketing.streams.async_job import InsightAsyncJob, ParentAsyncJob, Status, update_in_batch


@pytest.fixture(name="adreport")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import pytest
from facebook_business.api import FacebookAdsApiBatch

from source_facebook_marketing.api import MyFacebookAdsApi
from source_facebook_marketing.streams.async_job import InsightAsyncJob, ParentAsyncJob
from source_facebook_marketing.streams.async_job_manager import InsightAsyncJobManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pytest
from airbyte_cdk.models import SyncMode
from pendulum import duration

from source_facebook_marketing.streams import AdsInsights
from source_facebook_marketing.streams.async_job import AsyncJob, InsightAsyncJob

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@
import pytest
from facebook_business import FacebookSession
from facebook_business.api import FacebookAdsApi, FacebookAdsApiBatch

from source_facebook_marketing.api import MyFacebookAdsApi
from source_facebook_marketing.streams.base_streams import (
FBMarketingIncrementalStream,
FBMarketingStream,
)
from source_facebook_marketing.streams.base_streams import FBMarketingIncrementalStream, FBMarketingStream


@pytest.fixture(name="mock_batch_responses")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@
from airbyte_cdk.utils import AirbyteTracedException
from facebook_business import FacebookAdsApi, FacebookSession
from facebook_business.exceptions import FacebookRequestError

from source_facebook_marketing.streams import (
Activities,
AdAccount,
AdCreatives,
Campaigns,
Videos,
)
from source_facebook_marketing.streams import Activities, AdAccount, AdCreatives, Campaigns, Videos

FB_API_VERSION = FacebookAdsApi.API_VERSION

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from airbyte_cdk.models import OrchestratorType, Type
from airbyte_cdk.sources import Source

from source_facebook_marketing.config_migrations import MigrateAccountIdToArray
from source_facebook_marketing.source import SourceFacebookMarketing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from airbyte_cdk.models import FailureType, SyncMode
from airbyte_cdk.utils.traced_exception import AirbyteTracedException
from facebook_business import FacebookAdsApi, FacebookSession

from source_facebook_marketing.api import API
from source_facebook_marketing.streams import AdAccount, AdCreatives, AdsInsights

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{"start_date": "2021-02-08T00:00:00Z", "end_date": "2021-02-15T00:00:00Z", "custom_insights": [{"name": "custom_insight_stream", "fields": ["account_name", "clicks", "cpc", "account_id", "ad_id"], "breakdowns": ["gender"], "action_breakdowns": []}], "account_id": "01234567890", "access_token": "access_token"}
{
"start_date": "2021-02-08T00:00:00Z",
"end_date": "2021-02-15T00:00:00Z",
"custom_insights": [
{
"name": "custom_insight_stream",
"fields": ["account_name", "clicks", "cpc", "account_id", "ad_id"],
"breakdowns": ["gender"],
"action_breakdowns": []
}
],
"account_id": "01234567890",
"access_token": "access_token"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
SyncMode,
)
from facebook_business import FacebookAdsApi, FacebookSession

from source_facebook_marketing import SourceFacebookMarketing
from source_facebook_marketing.spec import ConnectorConfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import pendulum
import pytest
from pendulum import duration

from source_facebook_marketing.api import MyFacebookAdsApi
from source_facebook_marketing.streams import (
AdSets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
import freezegun
import pendulum
import pytest

from source_facebook_marketing.utils import (
DATA_RETENTION_PERIOD,
validate_end_date,
validate_start_date,
)
from source_facebook_marketing.utils import DATA_RETENTION_PERIOD, validate_end_date, validate_start_date

TODAY = pendulum.local(2023, 3, 31)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

from airbyte_cdk.models.airbyte_protocol import ConnectorSpecification
from airbyte_cdk.sources import Source
from airbyte_cdk.sources.utils.schema_helpers import (
check_config_against_spec_or_exit,
split_config,
)
from airbyte_cdk.sources.utils.schema_helpers import check_config_against_spec_or_exit, split_config


def command_check(source: Source, config):
Expand Down

0 comments on commit ad7bcf4

Please sign in to comment.