-
Notifications
You must be signed in to change notification settings - Fork 50
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( | ||
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 thedir
argument to preserve existing behavior. With the current change,TEMP_DIR
is always provided.Would it make sense to check if
TEMP_DIR
corresponds 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_DIR
when calling the tempfile function. Given that inairbyte/constants.py
,TEMP_DIR
is set totempfile.gettempdir()
when no override is provided (i.e., whenAIRBYTE_TEMP_DIR
is not set), wouldn’t it be better to conditionally omit thedir
argument so that we preserve the original behavior? For instance, you might consider:dir=TEMP_DIR
ifTEMP_DIR
does not equaltempfile.gettempdir()
None
Would 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_DIR
is never None and checking thatTEMP_DIR
is different fromtempfile.gettempdir()
seems unnecessary, just verbose, since the result will be the same. wdyt?