Skip to content

Conversation

@Saiyashwanth7
Copy link
Contributor

Switch from UUID v4 to v7

Resolves #126

Changes Made:

  • Replaced uuid_pkg.uuid4 with uuid7 from uuid6 package across 6 files
  • Updated imports to use from uuid6 import uuid7

@Saiyashwanth7
Copy link
Contributor Author

Added uuid6 to pyproject.toml; Module not found error resolved.

@Saiyashwanth7
Copy link
Contributor Author

  • Resolved the inconsistency issue in user.py and cache.py

@Saiyashwanth7
Copy link
Contributor Author

Screenshot 2025-08-30 115350 -Fixed the type inconsistencies and tested using docker-compose.test.yml. Passed all the tests.

@igorbenav
Copy link
Collaborator

Thanks, @Saiyashwanth7, I'll review it as soon as possible

Copy link
Collaborator

@LucasQR LucasQR left a comment

Choose a reason for hiding this comment

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

Besides the dev comments left in the code it seems to work well, just take them out, please

return cast(UserRead, db_user)


# In src/app/api/v1/users.py, replace the patch_user function with this:
Copy link
Collaborator

Choose a reason for hiding this comment

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

take out the developer comments on the lines: 75, 89, 100, 105 and 110


if user:
return cast(dict[str, Any], user)
# Ensure consistent return type - always return dict
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments on lines 37, 38 and 40

@@ -1,4 +1,5 @@
import uuid as uuid_pkg
from uuid6 import uuid7 #126
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments

@@ -1,4 +1,5 @@
import uuid as uuid_pkg
from uuid6 import uuid7 #126
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments

cursor, keys = await client.scan(cursor, match=pattern, count=100)
if keys:
await client.delete(*keys)
if cursor == 0: # cursor returns to 0 when scan is complete
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments

@@ -1,7 +1,8 @@
import uuid as uuid_pkg
from datetime import UTC, datetime
from uuid6 import uuid7 #126
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments


id: Mapped[int] = mapped_column("id", autoincrement=True, nullable=False, unique=True, primary_key=True, init=False)

# Option 1: Use integer ID as primary key (recommended for compatibility)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments

sample_user_read.username = username # Make sure usernames match
user_update = UserUpdate(name="New Name")

# Convert the UserRead model to a dictionary for the mock
Copy link
Collaborator

Choose a reason for hiding this comment

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

Take out the developer comments on lines: 120, 122, 128 and 141

@LucasQR LucasQR merged commit e0a436d into benavlabs:main Sep 17, 2025
3 checks passed
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.

Switch from UUID v4 to v7

4 participants