Skip to content
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

Fix pydantic v2 warnings #560

Closed
JenySadadia opened this issue Oct 24, 2024 · 2 comments
Closed

Fix pydantic v2 warnings #560

JenySadadia opened this issue Oct 24, 2024 · 2 comments
Assignees

Comments

@JenySadadia
Copy link
Collaborator

Receiving pydantic warning on kci user group join command:

kernelci-api          | INFO:     172.21.0.1:46482 - "GET /latest/users?username=test_user&limit=100&offset=0 HTTP/1.1" 200 OK
kernelci-api          | /home/kernelci/.local/lib/python3.11/site-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:
kernelci-api          |   Expected `str` but got `UserGroup` with value `UserGroup(id=ObjectId('64...16ad'), name='kernelci')` - serialized value may not be as expected
kernelci-api          |   Expected `str` but got `UserGroup` with value `UserGroup(id=ObjectId('67...a017faa3'), name='test')` - serialized value may not be as expected
kernelci-api          |   return self.__pydantic_serializer__.to_python(
kernelci-api          | User 670e4486de0eba06b43e645f test_user has been updated.
kernelci-api          | INFO:     172.21.0.1:46492 - "PATCH /latest/user/670e4486de0eba06b43e645f HTTP/1.1" 200 OK

The warnings are also observed while running unit tests.

@JenySadadia
Copy link
Collaborator Author

@nuclearcat reported pydantic warnings below:

INFO:     10.224.0.101:55470 - "GET /latest/nodes?parent=6733238c68b6090bcedcc978&limit=100&offset=0 HTTP/1.1" 200 OK
/usr/local/lib/python3.11/site-packages/pydantic/main.py:390: UserWarning: Pydantic serializer warnings:
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  Expected `url` but got `str` with value `'https://kciapistagingsto...GGQivo89HKZbD78gcxvc%3D'` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `url` but got `str` with value `'https://git.kernel.org/p...t/sashal/linus-next.git'` - serialized value may not be as expected
  PydanticSerializationUnexpectedValue: Expected `url` but got `str` with value `'https://git.kernel.org/p...t/sashal/linus-next.git'` - serialized value may not be as expected
  return self.__pydantic_serializer__.to_python(

@JenySadadia
Copy link
Collaborator Author

JenySadadia commented Nov 21, 2024

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

No branches or pull requests

1 participant