-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Refactor python sources #1331
Refactor python sources #1331
Conversation
/test connector=all
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Much better.
I don't think a developer should have to know about ConfigContainer at all. While you have removed it from the base python source, it is now exposed in the base singer source. I don't think it is necessary. See some comments below / let me know if I'm missing something.
airbyte-integrations/bases/base-python/base_python/integration.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/bases/base-python/base_python/integration.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/bases/base-python/base_python/integration.py
Outdated
Show resolved
Hide resolved
) | ||
|
||
# can be overridden to change an input catalog | ||
def transform_catalog(self, catalog_path: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what transform_catalog
and transform_state
needed for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are overridden in singer to return path strings instead of actual catalogs and state objects
...nnectors/source-facebook-marketing-api-singer/source_facebook_marketing_api_singer/source.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks a lot better now!
% killing ConfigContainer completely
33f2520
to
0b7ebf5
Compare
/test connector=all
|
/test connector=all
|
since some singer source may need to persist extra temp file
from tap_google_analytics import GAClient | ||
|
||
CREDENTIALS_FILE = os.path.join(tempfile.gettempdir(), "credentials.json") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tempfile is never deleted so it might cause problems as more and more sync are run using this source... (plus it is writing some sensitive credentials information)
Instead, a new method on the source abstraction called configure
allows source to override and add extra temp file to persist in the Temp_dir context. This is automatically deleted when the source is done running
I will open new PR to bump versions and publish separately |
What
Closes #1321
Closes #1322
How
Pre-merge Checklist
Recommended reading order
airbyte-integrations/bases/base-python/base_python/integration.py
airbyte-integrations/bases/base-singer/base_singer/source.py