From d67e9ffa9e67cf231ce803f101a9e4c46b3227c8 Mon Sep 17 00:00:00 2001 From: Chris White Date: Mon, 9 Sep 2024 16:25:01 -0700 Subject: [PATCH] Fix query for subflow cancellation (#15292) --- .github/workflows/python-tests.yaml | 2 +- flows/worker.py | 2 +- requirements-client.txt | 2 +- src/prefect/server/services/cancellation_cleanup.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-tests.yaml b/.github/workflows/python-tests.yaml index 116f7bc5cc44..6dbd40591cef 100644 --- a/.github/workflows/python-tests.yaml +++ b/.github/workflows/python-tests.yaml @@ -327,7 +327,7 @@ jobs: - name: Install packages run: | python -m pip install -U uv - uv pip install --upgrade --system -e .[dev] 'pydantic>=2.4,<3' + uv pip install --upgrade --system -e .[dev] 'pydantic>=2.4,<2.9.0' - name: Set PREFECT_EXPERIMENTAL_ENABLE_PYDANTIC_V2_INTERNALS env var run: echo "PREFECT_EXPERIMENTAL_ENABLE_PYDANTIC_V2_INTERNALS=1" >> $GITHUB_ENV diff --git a/flows/worker.py b/flows/worker.py index da710af06c0f..0f9c4fbcb478 100644 --- a/flows/worker.py +++ b/flows/worker.py @@ -15,7 +15,7 @@ def main(): TEST_SERVER_VERSION ) >= Version("2.8"): subprocess.check_call( - ["python", "-m", "pip", "install", "prefect-kubernetes"], + ["python", "-m", "pip", "install", "prefect-kubernetes<0.5.0"], stdout=sys.stdout, stderr=sys.stderr, ) diff --git a/requirements-client.txt b/requirements-client.txt index 9fe029c5a5b0..6b8e303a012b 100644 --- a/requirements-client.txt +++ b/requirements-client.txt @@ -21,7 +21,7 @@ pathspec >= 0.8.0 pendulum < 3.0; python_version < '3.12' pendulum >= 3.0.0, <4; python_version >= '3.12' # the version constraints for pydantic are merged with those from fastapi 0.103.2 -pydantic[email]>=1.10.0,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0 +pydantic[email]>=1.10.0,!=2.0.0,!=2.0.1,!=2.1.0,<2.9.0 pydantic_core >= 2.12.0, < 3.0.0 python_dateutil >= 2.8.2, < 3.0.0 python-slugify >= 5.0, < 9.0 diff --git a/src/prefect/server/services/cancellation_cleanup.py b/src/prefect/server/services/cancellation_cleanup.py index 14073f3c4740..ea44f1266c08 100644 --- a/src/prefect/server/services/cancellation_cleanup.py +++ b/src/prefect/server/services/cancellation_cleanup.py @@ -84,8 +84,8 @@ async def clean_up_cancelled_subflow_runs(self, db): db.FlowRun.state_type == states.StateType.RUNNING, db.FlowRun.state_type == states.StateType.PAUSED, db.FlowRun.state_type == states.StateType.CANCELLING, - db.FlowRun.id > high_water_mark, ), + db.FlowRun.id > high_water_mark, db.FlowRun.parent_task_run_id.is_not(None), ) .order_by(db.FlowRun.id)