Comments (5)
Hey @lucasgadams -- We've intentionally kept the library to use pydantic.v1
so that the SDK can leverage both pydantic V1 and V2 depending on the consumer's dependency. Once Merge no longer cares about supporting v1 users, we can upgrade the dependency.
Would be helpful to understand the specific issues you are running into as you try to leverage the v1 models and we can share solutions on a case-by-case basis.
from merge-python-client.
Running into some issues caused by mergepythonclient -> Pydantic V1 today -- pydantic/pydantic#9607.
Think this highlights that attempting to migrate to Pydantic 2.0 can be helpful for stability. Our entire backend is blocked from deployment cause of this pydantic V1 dependency.
On some use-cases that we might like to do, one example is to extend a Merge class with fields that are based on other Pydantic models (V2).
from merge-python-client.
While the specific issue noted with pydantic 1.0 not being compatible with python 3.12.4 has been resolved, we are still having broader trouble with the use of v1 pydantic models in our code base. Basically we utilize the merge pydantic objects in various ways, and specifically might wrap them in other pydantic classes or use them as fields in other pydantic classes. Like:
class MergeDocument(BaseModel): # A v2 pydantic model
info: File ## This is merge filestorage.File type, a V1 pydantic model so we have trouble using it as a field here
integration_type: IntegrationType
company_id: uuid.UUID
We've migrated our whole codebase to V2, and so incorporating these V1 models presents some challenges.
from merge-python-client.
Hi our deployment cycle broke due to Pydantic 2.0 not being supported. In actuality, it's because Pydantic was upgraded to v1.10.15 in our list of dependencies. This patch was a breaking change in Pydantic, but it also introduced an import error in Merge's SDK. Error log:
from .account import Account
.venv/lib/python3.10/site-packages/ddtrace/internal/module.py:220: in _exec_module
self.loader.exec_module(module)
.venv/lib/python3.10/site-packages/merge/resources/accounting/types/account.py:6: in <module>
from ....core.datetime_utils import serialize_datetime
.venv/lib/python3.10/site-packages/ddtrace/internal/module.py:220: in _exec_module
self.loader.exec_module(module)
.venv/lib/python3.10/site-packages/merge/core/__init__.py:6: in <module>
from .jsonable_encoder import jsonable_encoder
.venv/lib/python3.10/site-packages/ddtrace/internal/module.py:220: in _exec_module
self.loader.exec_module(module)
.venv/lib/python3.10/site-packages/merge/core/jsonable_encoder.py:39: in <module>
encoders_by_class_tuples = generate_encoders_by_class_tuples(pydantic.json.ENCODERS_BY_TYPE)
E AttributeError: module 'pydantic.v1' has no attribute 'json'. Did you mean: 'Json'?
By supporting Pydantic v1.10.15, Pydantic v2 may as well be supported as the APIs for v1.10.15 and v2 are compatible. Please support so that we may continue to receive security patches from Pydantic which is core to our services. Thanks
from merge-python-client.
Would really be great to just upgrade the library so that it is pydantic 2.0 by default and instead has some backwards compat for people who are still using v1. Much more ideal than keeping it on V1
from merge-python-client.
Related Issues (16)
- How do you pass in your account token? HOT 1
- Filestorage files download casts/returns None instead of returning the downloaded bytes HOT 2
- Update `httpx` HOT 3
- client.filestorage.users.list(is_me=True) doesn't work HOT 4
- Download file will run into 502 error HOT 10
- pydantic.error_wrappers.ValidationError: 6 validation errors for ParsingModel[PaginatedFileList] HOT 11
- Support for pydantic v2 HOT 4
- Typed integration names HOT 2
- Lexicographic order HOT 1
- Expand object not using value. HOT 3
- Soften pydantic upper version constraint HOT 5
- Asyncio support in README HOT 1
- Python type checking return list base model HOT 1
- Latest version broken: Validation Error for File PermissionsRequest HOT 2
- Does merge.dev list enumerated values anywhere? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from merge-python-client.