Skip to content

Return 404 when semantic models disappear during deletion - #5499

Merged
flyrain merged 2 commits into
apache:mainfrom
flyrain:yf/semantic-model-drop-not-found
Sep 12, 2026
Merged

flyrain merged 2 commits into
apache:mainfrom
flyrain:yf/semantic-model-drop-not-found

Conversation

@flyrain

@flyrain flyrain commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Deleting a semantic model currently returns HTTP 500 if the model or its catalog path disappears after resolution and before the deletion is persisted. Return NoSuchSemanticModelException (HTTP 404) for ENTITY_NOT_FOUND and CATALOG_PATH_CANNOT_BE_RESOLVED, consistent with deleting a model that is already missing at lookup time. Other persistence failures retain their existing handling.

Related to #4522

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Related to Add OSI (Open Semantic Interchange) Support in Polaris #4522
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic: the status mapping is direct and needs no additional comments.
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed): no additional guide changes; the API specification already documents HTTP 404 for a missing model.

@github-project-automation github-project-automation Bot moved this to PRs In Progress in Basic Kanban Board Sep 11, 2026
@flyrain flyrain mentioned this pull request Sep 11, 2026
6 tasks done
@flyrain
flyrain marked this pull request as ready for review September 11, 2026 17:42
Copilot AI lite review requested due to automatic review settings September 11, 2026 17:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Pull request overview

Updates semantic model deletion to return HTTP 404 when the model or catalog path disappears during deletion.

Changes:

  • Maps relevant persistence statuses to NoSuchSemanticModelException.
  • Adds parameterized coverage for both missing-resource statuses.
  • Documents the behavior in the changelog.
File summaries
File Description
extensions/semantic-models/src/test/java/org/apache/polaris/service/catalog/semanticmodel/SemanticModelCatalogTest.java Updated as part of this pull request.
extensions/semantic-models/src/main/java/org/apache/polaris/service/catalog/semanticmodel/SemanticModelCatalog.java Updated as part of this pull request.
CHANGELOG.md Updated as part of this pull request.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"Failed to drop semantic model %s error status: %s with extraInfo: %s",
identifier, result.getReturnStatus(), result.getExtraInformation()));
switch (result.getReturnStatus()) {
case ENTITY_NOT_FOUND, CATALOG_PATH_CANNOT_BE_RESOLVED ->

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is consistent with table/view drop behavior.

dimas-b
dimas-b previously approved these changes Sep 11, 2026
@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Sep 11, 2026
@flyrain
flyrain merged commit 4812619 into apache:main Sep 12, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants