-
Notifications
You must be signed in to change notification settings - Fork 351
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
Update: Pydantic V2 #1889
Update: Pydantic V2 #1889
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to use https://docs.pydantic.dev/latest/migration/#code-transformation-tool , while it won't solve everything it will be a good starting point.
Getting a number of errors when I run the tests locally. Not sure why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Dan, all looks good, but I did run bump-pydantic --diff bittensor/
to check, and I got this:
[19:40:24] Start bump-pydantic. main.py:61
Found 66 files to process. main.py:78
--- bittensor/tensor.py
+++ bittensor/tensor.py
@@ -171,7 +171,7 @@
# Represents the tensor buffer data.
buffer: Optional = Field(
- title="buffer",
+ None, title="buffer",
description="Tensor buffer data. This field stores the serialized representation of the tensor data.",
examples=["0x321e13edqwds231231231232131"],
frozen=True,
[19:41:04] Found 1 errors. Please check the log.txt file.
and the log.txt file shows:
==SUPRESS==
^A syntax error happened on bittensor/utils/__init__.py. This file cannot be formatted.
Check https://github.com/pydantic/bump-pydantic/issues/124 for more information.
Syntax Error @ 1:1.
parser error: error at 1:2: expected one of (, *, +, -, ..., AWAIT, EOF, False, NAME, NUMBER, None, True, [, break, continue, lambda, match, not, pass, ~
Just check into those.
… tensor.py buffer.
@thewhaleking I have addressed the Pydantic bump change. |
Update Pydantic from V1 to V2. Some of the changes between V1 and V2 have breaking impacts, and our tests will need to be adjusted to reflect those changes.