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

Conversation

jshearer
Copy link
Contributor

@jshearer jshearer commented Feb 16, 2024

Description:

Because source-python doesn't use a sub-package like all other python packages do, it needed different treatment. This different treatment broke everything, so this PR undoes it and fixes the problem a different way.

tl;dr, the upper source-python package was a special namespace package, and Airbyte CDK was using a specific function to load the spec.yaml file that doesn't work on namespace packages, apparently. So the fix ended up being to move spec.yaml up a directory and add a blank __init__.py to source-python to make it not a namespace package... k ¯_(ツ)_/¯


This change is Reviewable

@jshearer jshearer force-pushed the fix/python_packages branch from e630e12 to 584d5d6 Compare February 16, 2024 20:41
@@ -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)

Copy link
Member

@dyaffe dyaffe left a comment

Choose a reason for hiding this comment

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

LGTM

@dyaffe dyaffe merged commit 2a593c6 into main Feb 16, 2024
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants