Skip to content

Feat: Add install_root arg for get_source(), allows users to override virtualenv base path#268

Merged
Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
airbytehq:mainfrom
tqtensor:main
Jun 4, 2024
Merged

Feat: Add install_root arg for get_source(), allows users to override virtualenv base path#268
Aaron ("AJ") Steers (aaronsteers) merged 3 commits into
airbytehq:mainfrom
tqtensor:main

Conversation

@tqtensor

@tqtensor Tang Quoc Thai (tqtensor) commented Jun 2, 2024

Copy link
Copy Markdown
Contributor

As I want to run PyAirbyte on AWS Lambda, I encountered this error because on Lambda there is one place folder that the program can write data into is /tmp/

I searched through the current source code of PyAirbyte and found out that there is an argument named install_root to specify where the new .venv-source-name folder is.

So, I made this change to install the source connector virtual environment to the tmp folder.

Exception:

airbyte.exceptions.AirbyteSubprocessFailedError: AirbyteSubprocessFailedError: Subprocess failed.
--
Run Args: ['/var/lang/bin/python3.10', '-m', 'venv', '/var/task/.venv-source-stripe']
Exit Code: 1
Log output:
Error: [Errno 30] Read-only file system: '/var/task/.venv-source-stripe'

Summary by CodeRabbit

  • New Features
    • Added a new parameter install_root to functions for specifying the root directory when creating a virtual environment for connectors.

@tqtensor Tang Quoc Thai (tqtensor) changed the title Feat: add install_root arg for get_source Feat: Add install_root arg for get_source Jun 2, 2024
@aaronsteers

Copy link
Copy Markdown
Member

/fix-pr

@aaronsteers

Copy link
Copy Markdown
Member

Tang Quoc Thai (@tqtensor) - This looks great to me. Thanks for this contribution.

Can you help make the linter happy again by adding a noqa for PLR0913 on the _get_source( declaration line?

@tqtensor

Copy link
Copy Markdown
Contributor Author

Hi Aaron ("AJ") Steers (@aaronsteers), that issue is raised because we add too many arguments; one workaround is using kwargs or making a data class for these arguments to abstract them. I prefer to go with the data class or pydantic.

@aaronsteers

Aaron ("AJ") Steers (aaronsteers) commented Jun 3, 2024

Copy link
Copy Markdown
Member

Hi Aaron ("AJ") Steers (@aaronsteers), that issue is raised because we add too many arguments; one workaround is using kwargs or making a data class for these arguments to abstract them. I prefer to go with the data class or pydantic.

Tang Quoc Thai (@tqtensor) I appreciate the attention to proper refactoring. However, I would rather not add additional refactoring at this time. This is in part because we have at least one other PR that is targeting this same code location; I'd prefer to avoid adding merge conflicts to resolve in related PRs, and to reduce scope/effort to get this merged. I think the simplest and safest path for now is just to add another lint ignore for now.

Does that sound okay for now?

@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title Feat: Add install_root arg for get_source Feat: Add install_root arg for get_source(), allows users to override virtualenv base path Jun 3, 2024
@coderabbitai

This comment was marked as spam.

coderabbitai[bot]

This comment was marked as spam.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 336ec6c and 01b8864.

Files selected for processing (1)
  • airbyte/sources/util.py (7 hunks)
Files skipped from review as they are similar to previous changes (1)
  • airbyte/sources/util.py

@tqtensor

Copy link
Copy Markdown
Contributor Author

Hi Aaron ("AJ") Steers (@aaronsteers), that issue is raised because we add too many arguments; one workaround is using kwargs or making a data class for these arguments to abstract them. I prefer to go with the data class or pydantic.

Tang Quoc Thai (@tqtensor) I appreciate the attention to proper refactoring. However, I would rather not add additional refactoring at this time. This is in part because we have at least one other PR that is targeting this same code location; I'd prefer to avoid adding merge conflicts to resolve in related PRs, and to reduce scope/effort to get this merged. I think the simplest and safest path for now is just to add another lint ignore for now.

Does that sound okay for now?

Aaron ("AJ") Steers (@aaronsteers), Yes, it is fine as you have a plan or ongoing work to refactor that, so I did add the #noqa for PLR0913.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great! Thanks again for this contribution! 🚀

@aaronsteers

Aaron ("AJ") Steers (aaronsteers) commented Jun 4, 2024

Copy link
Copy Markdown
Member

/test-pr

PR test job started... Check job output.

❌ Tests failed.
PR test job started... Check job output.

❌ Tests failed.

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