-
Notifications
You must be signed in to change notification settings - Fork 138
Open
Labels
questionAsking for support or clarificationAsking for support or clarificationset-theoretic typesunions, intersections and moreunions, intersections and more
Description
Question
We've got some code that has to support both pydantic 1 and 2 for historical reasons.
It looks like this:
PYDANTIC_IS_V1 = int(pydantic.version.VERSION.split(".")[0]) < 2
if PYDANTIC_IS_V1:
class DatabagModel(BaseModel): # type: ignore
...
else:
class DatabagModel(BaseModel):
...Attempting to use this model is rejected by ty:
warning[unsupported-base]: Unsupported class base with type `<class 'DatabagModel'> | <class 'DatabagModel'>`
--> lib/charms/traefik_k8s/v2/ingress.py:238:30
|
238 | class IngressRequirerAppData(DatabagModel):
| ^^^^^^^^^^^^Version
ty 0.0.1-alpha.7 (afb20f6 2025-05-26)
Metadata
Metadata
Assignees
Labels
questionAsking for support or clarificationAsking for support or clarificationset-theoretic typesunions, intersections and moreunions, intersections and more