Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -889,9 +889,9 @@ def execute_callable(self):

with TemporaryDirectory(prefix="venv") as tmp_dir:
tmp_path = Path(tmp_dir)
tmp_dir, temp_venv_dir = tmp_path.relative_to(tmp_path.anchor).parts
custom_pycache_prefix = Path(sys.pycache_prefix or "")
venv_python_cache_dir = Path.cwd() / custom_pycache_prefix / tmp_dir / temp_venv_dir
r_path = tmp_path.relative_to(tmp_path.anchor)
venv_python_cache_dir = Path.cwd() / custom_pycache_prefix / r_path
self._prepare_venv(tmp_path)
python_path = tmp_path / "bin" / "python"
result = self._execute_python_callable_in_subprocess(python_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
get_current_context,
)
from airflow.providers.standard.utils.python_virtualenv import execute_in_subprocess, prepare_virtualenv
from airflow.utils import timezone

try:
from airflow.sdk import timezone
except ImportError:
from airflow.utils import timezone # type: ignore[attr-defined,no-redef]
from airflow.utils.session import create_session
from airflow.utils.state import DagRunState, State, TaskInstanceState
from airflow.utils.trigger_rule import TriggerRule
Expand Down Expand Up @@ -1672,7 +1676,7 @@ def test_execute_callable_pycache_cleanup(
):
custom_pycache_prefix = "custom/__pycache__"
tempdir_name = "tmp"
venv_dir_temp_name = "venvrandom"
venv_dir_temp_name = "dummy12345/venvrandom"
venv_path_tmp = f"/{tempdir_name}/{venv_dir_temp_name}"
expected_cleanup_path = Path.cwd() / custom_pycache_prefix / tempdir_name / venv_dir_temp_name

Expand Down
Loading