-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Bug: UUIDBase ID Value Changed from UUID to Bytes #511
Comments
Thanks for reporting this @junhopark97! I am able to reproduce this. According to |
Actually, this may be due to something in from uuid import UUID
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
from polyfactory.factories.sqlalchemy_factory import SQLAlchemyFactory
class Base(DeclarativeBase):
...
class User(Base):
__tablename__ = "users"
id: Mapped[UUID] = mapped_column(primary_key=True)
class UserFactory(SQLAlchemyFactory[User]):
pass
assert isinstance(UserFactory.build().id, UUID) @cofin any ideas? |
Looking here https://github.com/jolt-org/advanced-alchemy/blob/main/advanced_alchemy/types/guid.py#L38 it seems the mapped typed for UUID in advanced alchemy uses binary under the hood. By my understanding, |
Thanks @guacs, @adhtruong! |
Description
In the example below,
UserFactory.build().id
outputs a UUID.When upgrading from version
polyfactory==2.14.1
topolyfactory==2.15.0
, it is observed thatUserFactory.build().id
now outputs Bytes instead of a UUID.Is the output in Bytes intended? Am I missing something?
MCVE
Steps to reproduce
No response
Screenshots
No response
Logs
Release Version
2.15.0
Platform
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
The text was updated successfully, but these errors were encountered: