-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Initial Checks
- I confirm that I'm using Pydantic V2
Description
I understand that ConfigDict
is the right thing to do at this point, we had some compat code that handled v1 objects in the case of a v2 pydantic install which is where our users encountered this.
we easily worked around this but reporting because it technically seems like a breaking change
seems related to #11714
» uv run --with 'pydantic==2.11.4' repros/pydantic/configdict.py
Traceback (most recent call last):
File "/Users/nate/github.com/prefecthq/prefect/repros/pydantic/configdict.py", line 7, in <module>
Model = create_model("Model", __config__=Config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/Library/Caches/uv/archive-v0/a1MACwVa0TRCWn5WltviZ/lib/python3.12/site-packages/pydantic/main.py", line 1761, in create_model
return meta(
^^^^^
File "/Users/nate/Library/Caches/uv/archive-v0/a1MACwVa0TRCWn5WltviZ/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 110, in __new__
config_wrapper = ConfigWrapper.for_model(bases, namespace, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/nate/Library/Caches/uv/archive-v0/a1MACwVa0TRCWn5WltviZ/lib/python3.12/site-packages/pydantic/_internal/_config.py", line 138, in for_model
config_new.update(config_from_namespace)
TypeError: 'type' object is not iterable
» uv run --with 'pydantic==2.11.3' repros/pydantic/configdict.py
{'properties': {}, 'title': 'Model', 'type': 'object'}
Example Code
from pydantic import create_model
class Config: ...
Model = create_model("Model", __config__=Config)
print(Model.model_json_schema())
Python, Pydantic & OS Version
pydantic version: 2.11.4
pydantic-core version: 2.33.2
pydantic-core build: profile=release pgo=false
python version: 3.12.8 (main, Jan 14 2025, 23:36:58) [Clang 19.1.6 ]
platform: macOS-15.3.2-arm64-arm-64bit
related packages: typing_extensions-4.13.2 pydantic-settings-2.9.1 pydantic-extra-types-2.10.4 mypy-1.15.0 typing_extensions-4.13.2 fastapi-0.115.12 pyright-1.1.400
commit: unknown
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
- <
2F1B
div class="Milestone-module__hiddenPlaceholder--tPOjC">