Incompatability with Pydantic 2.0
Closed this issue · 6 comments
- Ntropy SDK version: 4.16.0
- Python version: 3.8.12
- Operating System: MacOS
Description
When attempting to start our Django application during CI/CD, we got the following error:
File "/usr/local/lib/python3.8/site-packages/ntropy_sdk/ntropy_sdk.py", line 83, in <module>
class Transaction(BaseModel):
File "/usr/local/lib/python3.8/site-packages/ntropy_sdk/ntropy_sdk.py", line 127, in Transaction
country: Optional[str] = Field(
File "/usr/local/lib/python3.8/site-packages/pydantic/fields.py", line 707, in Field
raise PydanticUserError('`regex` is removed. use `pattern` instead', code='removed-kwargs')
pydantic.errors.PydanticUserError: `regex` is removed. use `pattern` instead
For further information visit https://errors.pydantic.dev/2.0/u/removed-kwargs
It looks like it's the regex
parameter to Field on line 128 of ntropy_sdk/ntropy_sdk.py
. We don't need to use Pydantic 2.0 at the moment, so we'll be moving back to 1.10, but thought I'd put this here just in case y'all hadn't seen it come up yet.
When I checked the diff between 4.16 and 4.19.0rc5 I didn't see this fixed, but please of course close this issue if y'all have already handled it.
What I Did
N/A
@RobinKa thanks for the quick fix last month! Are there any plans to support Pydantic 2.0? We'd like to move the rest of our codebase to that but also don't want to deal with running these in parallel if at all possible.
Also, as a side note, are there release notes anywhere? I don't believe I saw anything in CHANGELOG.md about this, but could have missed them elsewhere.
Hey @judson-stevens-teampay . We will be migrating to pydantic 2.0 in our next version release which we expect to be sometime earlier next week. We've also missed the CHANGELOG updates for the last few versions, so these will be updated in the same release to cover the missing changes
Thanks @jorge-pessoa - do y'all happen to have an update on this change? We'd love to move to Pydantic 2.0 and this is the only thing holding us back at the moment. Thanks!
Hey @jorge-pessoa, checking in to see if y'all have an update?
Just for closure, this has been addressed since version 4.21.0