Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Python packages broke when introducing source-hubspot, this fixes all python packages #1270

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ WORKDIR /connector
COPY --from=builder /builder/connector ./$CONNECTOR_NAME
COPY --from=builder /builder/python ./python

ENV PYTHONPATH="/connector/$CONNECTOR_NAME"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that broke things -- all python packages (except source-hubspot) are now complaining that

File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/connector/source-airtable/__main__.py", line 2, in <module>
    from source_airtable import SourceAirtable
ImportError: cannot import name 'SourceAirtable' from 'source_airtable' (unknown location)

# Arg substitution in CMD doesn't seem to work
ENV CONNECTOR_NAME=$CONNECTOR_NAME
CMD python -m $CONNECTOR_NAME
Empty file added source-hubspot/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion source-hubspot/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import urllib
from flow_sdk import shim_airbyte_cdk
from source_hubspot import SourceHubspot
from .source_hubspot import SourceHubspot

scopes = [
"forms",
Expand Down
4 changes: 3 additions & 1 deletion source-hubspot/source_hubspot/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import logging
from itertools import chain
from pathlib import Path
from typing import Any, List, Mapping, Optional, Tuple

import requests
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from requests import HTTPError
from source_hubspot.streams import (
from .streams import (
API,
Campaigns,
Companies,
Expand Down Expand Up @@ -45,6 +46,7 @@
)



class SourceHubspot(AbstractSource):
logger = logging.getLogger('hubspot')

Expand Down
6 changes: 3 additions & 3 deletions source-hubspot/source_hubspot/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
from airbyte_cdk.sources.streams.http.requests_native_auth import Oauth2Authenticator, TokenAuthenticator
from airbyte_cdk.sources.utils.transform import TransformConfig, TypeTransformer
from requests import HTTPError, codes
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 APIv1Property, APIv3Property, GroupByKey, IRecordPostProcessor, IURLPropertyRepresentation, StoreAsIs
from .constants import OAUTH_CREDENTIALS, PRIVATE_APP_CREDENTIALS
from .errors import HubspotAccessDenied, HubspotInvalidAuth, HubspotRateLimited, HubspotTimeout, InvalidStartDateConfigError
from .helpers import APIv1Property, APIv3Property, GroupByKey, IRecordPostProcessor, IURLPropertyRepresentation, StoreAsIs

# we got this when provided API Token has incorrect format
CLOUDFLARE_ORIGIN_DNS_ERROR = 530
Expand Down
File renamed without changes.
Loading