apache/airflow

Hash Virtual Environment Cache Based on Actual Package Versions in `PythonVirtualEnvOperator`

Open

#41,328 创建于 2024年8月8日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)Python (16,781 fork)batch import
area:coregood first issuekind:featureprovider:standard

仓库指标

Star
 (44,809 star)
PR 合并指标
 (平均合并 7天 18小时) (30 天内合并 834 个 PR)

描述

Description

Update the PythonVirtualEnvOperator to hash the virtual environment cache based on the actual versions of the installed packages rather than just the checksum of the requirements. This change would ensure that the cache reflects the true state of the environment, avoiding issues with packages tagged as "latest" or other dynamic versioning.

Use case/motivation

Currently, when using the PythonVirtualEnvOperator, if dependencies in the requirements use tags like "latest", the checksum used for caching remains unchanged even if the package versions are updated. This can lead to situations where outdated versions of packages are used from the cache, causing potential inconsistencies and issues in workflows. By hashing the cache based on the actual versions of installed packages, the virtual environment would be refreshed appropriately whenever package versions change, ensuring that the most current versions are used.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

贡献者指南