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
2 changes: 1 addition & 1 deletion cosmos/operators/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
self.py_requirements = py_requirements or []
self.py_system_site_packages = py_system_site_packages
super().__init__(**kwargs)
self._venv_tmp_dir = TemporaryDirectory()
self._venv_tmp_dir: None | TemporaryDirectory[str] = None

@cached_property
def venv_dbt_path(
Expand Down
2 changes: 2 additions & 0 deletions tests/operators/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def test_run_command(
py_system_site_packages=False,
py_requirements=["dbt-postgres==1.6.0b1"],
)
assert venv_operator._venv_tmp_dir is None # Otherwise we are creating empty directories during DAG parsing time
# and not deleting them
venv_operator.run_command(cmd=["fake-dbt", "do-something"], env={}, context={})
run_command_args = mock_subprocess_hook.run_command.call_args_list
assert len(run_command_args) == 3
Expand Down