Skip to content

fix: add missing import for select and DatasetFiles in replace endpoint#480

Merged
JasonW404 merged 1 commit intomainfrom
fix/replace-endpoint-missing-import
May 6, 2026
Merged

fix: add missing import for select and DatasetFiles in replace endpoint#480
JasonW404 merged 1 commit intomainfrom
fix/replace-endpoint-missing-import

Conversation

@JasonW404
Copy link
Copy Markdown
Collaborator

Summary

Fix missing import in the newly added PUT /{file_id}/replace endpoint.

Problem

The endpoint was missing the required imports:

  • from sqlalchemy.future import select
  • from app.db.models import DatasetFiles

This caused a NameError: name 'select' is not defined when calling the API.

Solution

Added the missing imports inside the endpoint function, following the same pattern as the existing update_file_tags endpoint.

Copilot AI review requested due to automatic review settings May 6, 2026 04:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a runtime NameError in the annotation task API by adding the missing SQLAlchemy/model imports used by the PUT /task/{file_id}/replace endpoint, aligning it with the existing update_file_tags implementation pattern.

Changes:

  • Add select import inside replace_file_tags to support the query execution.
  • Add DatasetFiles import inside replace_file_tags to resolve the referenced ORM model.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JasonW404 JasonW404 merged commit 8f47ceb into main May 6, 2026
12 checks passed
@JasonW404 JasonW404 deleted the fix/replace-endpoint-missing-import branch May 6, 2026 04:57
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.

2 participants