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

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

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

tqtensor
Copy link
Contributor

@tqtensor tqtensor commented Jun 2, 2024

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 tqtensor changed the title Feat: add install_root arg for get_source Feat: Add install_root arg for get_source Jun 2, 2024
@aaronsteers aaronsteers self-requested a review June 3, 2024 15:16
@aaronsteers
Copy link
Contributor

/fix-pr

@aaronsteers
Copy link
Contributor

@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
Contributor Author

tqtensor commented Jun 3, 2024

Hi @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
Copy link
Contributor

aaronsteers commented Jun 3, 2024

Hi @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.

@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 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

This comment was marked as spam.

coderabbitai[bot]

This comment was marked as spam.

Copy link

@coderabbitai coderabbitai bot left a comment

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
Contributor Author

tqtensor commented Jun 3, 2024

Hi @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.

@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, 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
Contributor

@aaronsteers aaronsteers left a comment

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
Copy link
Contributor

aaronsteers commented Jun 4, 2024

/test-pr

PR test job started... Check job output.

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

❌ Tests failed.

@aaronsteers aaronsteers merged commit e8ea14a into airbytehq:main Jun 4, 2024
9 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