-
Notifications
You must be signed in to change notification settings - Fork 71
feat: Docker in Docker compatibility: add param "host_temp_dir" to get_source() and get_destination() #644
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| from __future__ import annotations | ||
|
|
||
| import os | ||
| import tempfile | ||
| from pathlib import Path | ||
|
|
||
|
|
||
|
|
@@ -64,9 +65,8 @@ def _str_to_bool(value: str) -> bool: | |
| """Convert a string value of an environment values to a boolean value.""" | ||
| return bool(value) and value.lower() not in {"", "0", "false", "f", "no", "n", "off"} | ||
|
|
||
|
|
||
| TEMP_DIR_OVERRIDE: Path | None = ( | ||
| Path(os.environ["AIRBYTE_TEMP_DIR"]) if os.getenv("AIRBYTE_TEMP_DIR") else None | ||
| TEMP_DIR: Path = Path( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an additional blank line after function definition. The linter expects 2 blank lines after a function definition, but there's only 1. This is causing the pipeline to fail with a formatting error. def _str_to_bool(value: str) -> bool:
"""Convert a string value of an environment values to a boolean value."""
return bool(value) and value.lower() not in {"", "0", "false", "f", "no", "n", "off"}
TEMP_DIR: Path = Path(You can fix this and other formatting issues by running
🧰 Tools🪛 Ruff (0.8.2)68-68: Expected 2 blank lines after class or function definition, found (1) Add missing blank line(s) (E305) |
||
| os.environ["AIRBYTE_TEMP_DIR"] if os.getenv("AIRBYTE_TEMP_DIR") else tempfile.gettempdir() | ||
| ) | ||
| """The directory to use for temporary files. | ||
|
|
||
|
|
||
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.
💡 Verification agent
🧩 Analysis chain
Consider the previous behavior with temporary directories.
According to previous feedback, when the temporary directory override is
None, the code should not supply thedirargument to preserve existing behavior. With the current change,TEMP_DIRis always provided.Would it make sense to check if
TEMP_DIRcorresponds to the system's default temp directory and omit the parameter in that case? wdyt?🏁 Script executed:
Length of output: 328
Conditional TEMP_DIR Parameter Suggestion
It looks like we're always passing
TEMP_DIRwhen calling the tempfile function. Given that inairbyte/constants.py,TEMP_DIRis set totempfile.gettempdir()when no override is provided (i.e., whenAIRBYTE_TEMP_DIRis not set), wouldn’t it be better to conditionally omit thedirargument so that we preserve the original behavior? For instance, you might consider:dir=TEMP_DIRifTEMP_DIRdoes not equaltempfile.gettempdir()NoneWould it make sense to implement a check like this? wdyt?
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.
TEMP_DIRis never None and checking thatTEMP_DIRis different fromtempfile.gettempdir()seems unnecessary, just verbose, since the result will be the same. wdyt?