Skip to content

Commit

Permalink
Move import to make PythonOperator working on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jscheffl committed Jun 25, 2024
1 parent 5f2da71 commit 0a7c454
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/operators/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
# under the License.
from __future__ import annotations

import fcntl
import importlib
import inspect
import json
Expand Down Expand Up @@ -790,6 +789,8 @@ def _ensure_venv_cache_exists(self, venv_cache_path: Path) -> Path:
venv_path.parent.mkdir(parents=True, exist_ok=True)
with open(f"{venv_path}.lock", "w") as f:
# Ensure that cache is not build by parallel workers
import fcntl

fcntl.flock(f, fcntl.LOCK_EX)

hash_marker = venv_path / "install_complete_marker.json"
Expand Down

0 comments on commit 0a7c454

Please sign in to comment.