Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use explicit e.state in bulk experiment delete query #8491

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

erikwilson
Copy link
Contributor

Description

Fix an error where bulk delete can fail when using a filter with a message like:
[bun] 13:29:26.577 SELECT 632µs SELECT "e"."id", CASE e.state::text WHEN 'STARTING' THEN 15 WHEN 'DELETE_FAILED' THEN 11 WHEN 'QUEUED' THEN 13 WHEN 'ACTIVE' THEN 1 WHEN 'PAUSED' THEN 2 WHEN 'STOPPING_ERROR' THEN 5 WHEN 'COMPLETED' THEN 6 WHEN 'ERROR' THEN 8 WHEN 'DELETING' THEN 10 WHEN 'RUNNING' THEN 16 WHEN 'UNSPECIFIED' THEN 0 WHEN 'STOPPING_COMPLETED' THEN 3 WHEN 'STOPPING_CANCELED' THEN 4 WHEN 'CANCELED' THEN 7 WHEN 'DELETED' THEN 9 WHEN 'PULLING' THEN 14 WHEN 'STOPPING_KILLED' THEN 12 END AS state, COUNT(model_versions.id) AS versions FROM experiments as e JOIN projects p ON e.project_id = p.id LEFT JOIN checkpoints_view c ON c.experiment_id = e.id LEFT JOIN model_versions ON model_versions.checkpoint_uuid = c.uuid WHERE (project_id = 1) AND (state IN ('CANCELED', 'COMPLETED', 'ERROR')) GROUP BY "e"."id" *pgconn.PgError: ERROR: column reference "state" is ambiguous (SQLSTATE 42702)

Test Plan

Adds automated test.

Commentary (optional)

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Ticket

@erikwilson erikwilson requested a review from a team as a code owner November 28, 2023 20:41
@cla-bot cla-bot bot added the cla-signed label Nov 28, 2023
Copy link

netlify bot commented Nov 28, 2023

Deploy Preview for determined-ui canceled.

Name Link
🔨 Latest commit 1a4a998
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/656666074f63580008f7d3d3

Copy link
Contributor

@stoksc stoksc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. only nit is maybe swap to a table driven test. i shouldve done that when i wrote this, if i followed my own advice. sorry.

@erikwilson erikwilson enabled auto-merge (squash) November 28, 2023 22:26
@erikwilson erikwilson merged commit f50f7db into main Nov 28, 2023
67 of 80 checks passed
@erikwilson erikwilson deleted the erikw/fix/bulk-experiment-delete branch November 28, 2023 23:06
@dannysauer dannysauer added this to the 0.26.5 milestone Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants