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

Incompatability with Pydantic 2.0 #161

Closed
judson-stevens-teampay opened this issue Jul 3, 2023 · 6 comments
Closed

Incompatability with Pydantic 2.0 #161

judson-stevens-teampay opened this issue Jul 3, 2023 · 6 comments

Comments

@judson-stevens-teampay
Copy link

  • 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
Copy link
Contributor

RobinKa commented Jul 3, 2023

Fixed this in #160 (having pydantic<2 as requirement) and pushed it as 4.19.0rc8.

@judson-stevens-teampay
Copy link
Author

@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.

@jorge-pessoa
Copy link
Contributor

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

@judson-stevens-teampay
Copy link
Author

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!

@judson-stevens-teampay
Copy link
Author

Hey @jorge-pessoa, checking in to see if y'all have an update?

@jorge-pessoa
Copy link
Contributor

Just for closure, this has been addressed since version 4.21.0

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

3 participants