Skip to content

fix(uuid): record containing uuid doesn't crash at create anymore #323

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

Closed
wants to merge 2 commits into from

Conversation

jbarreau
Copy link
Contributor

@jbarreau jbarreau commented Apr 2, 2025

No description provided.

Copy link

@Copilot 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

This PR fixes a crash when creating records by ensuring the UUID field is correctly processed based on whether the input value is a string.

  • Adds a type check to convert string values to UUID while leaving others unchanged.
Comments suppressed due to low confidence (1)

src/agent_toolkit/forestadmin/agent_toolkit/resources/collections/crud.py:405

  • Consider adding an additional check to confirm that 'value' is already a valid UUID instance when it's not a string. This can help ensure robust type consistency and prevent potential issues if 'value' is of an unexpected type.
record[field_name] = UUID(value) if isinstance(value, str) else value

@jbarreau jbarreau closed this Apr 2, 2025
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.

1 participant