jens-scheffler-bosch commented on code in PR #33355:
URL: https://github.com/apache/airflow/pull/33355#discussion_r1320374362
##########
airflow/operators/python.py:
##########
@@ -606,7 +613,39 @@ def _prepare_venv(self, venv_path: Path) -> None:
index_urls=self.index_urls,
)
+ def _ensure_venv_cache_exists(self, venv_cache_path: Path) -> Path:
+ """Helper to ensure a valid venv is set up and will create inplace."""
+ hash_object =
hashlib_wrapper.md5(",".join(self._requirements_list()).encode())
+ requirements_hash = hash_object.hexdigest()
+ venv_path = venv_cache_path / f"venv-{requirements_hash[0:8]}"
Review Comment:
Good idea. Added a `PythonVirtualenvOperator.cache_key` Variable which can
be used to create new hashes if needed as admin during runtime (no DAG changes
needed).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]