Skip to content

Commit

Permalink
chore: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
pnilan committed Nov 6, 2024
1 parent 493fed4 commit 68e3d32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,21 @@
from airbyte_cdk.sources.declarative.transformations import RecordTransformation
from airbyte_cdk.sources.types import Config, StreamSlice, StreamState


NEW_TO_LEGACY_FIELDS_MAPPING = {
"hs_lifecyclestage_": "hs_v2_date_entered_",
"hs_date_entered_": "hs_v2_date_entered_",
"hs_date_exited_": "hs_v2_date_exited_",
"hs_time_in_": "h2_v2_latest_time_in_"
"hs_time_in_": "h2_v2_latest_time_in_",
}

class NewToLegacyFieldTransformation(RecordTransformation):

def transform(self, record: Dict[str, Any], config: Optional[Config] = None, stream_state: Optional[StreamState] = None, stream_slice: Optional[StreamSlice] = None,
class NewToLegacyFieldTransformation(RecordTransformation):
def transform(
self,
record: Dict[str, Any],
config: Optional[Config] = None,
stream_state: Optional[StreamState] = None,
stream_slice: Optional[StreamSlice] = None,
) -> Mapping[str, Any]:
updated_record = copy.deepcopy(record)
for field_name, field_value in record.get("properties", {}).items():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from airbyte_cdk.entrypoint import logger
from airbyte_cdk.models import FailureType, SyncMode
from airbyte_cdk.sources import Source
from airbyte_cdk.sources.declarative.transformations import RecordTransformation
from airbyte_cdk.sources.streams import CheckpointMixin, Stream
from airbyte_cdk.sources.streams.availability_strategy import AvailabilityStrategy
from airbyte_cdk.sources.streams.core import StreamData
Expand All @@ -29,6 +30,7 @@
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
from airbyte_cdk.utils import AirbyteTracedException
from requests import HTTPError, codes
from source_hubspot.components import NewToLegacyFieldTransformation
from source_hubspot.constants import OAUTH_CREDENTIALS, PRIVATE_APP_CREDENTIALS
from source_hubspot.errors import HubspotAccessDenied, HubspotInvalidAuth, HubspotRateLimited, HubspotTimeout, InvalidStartDateConfigError
from source_hubspot.helpers import (
Expand All @@ -41,8 +43,6 @@
IURLPropertyRepresentation,
StoreAsIs,
)
from source_hubspot.components import NewToLegacyFieldTransformation
from airbyte_cdk.sources.declarative.transformations import RecordTransformation

# we got this when provided API Token has incorrect format
CLOUDFLARE_ORIGIN_DNS_ERROR = 530
Expand Down

0 comments on commit 68e3d32

Please sign in to comment.