Skip to content

Commit 1fbd393

Browse files
committed
pydantic v2 upgrade version
1 parent c4245dc commit 1fbd393

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
### 0.20.0
2+
### Breaking Changes
3+
* **Pydantic 2.x upgrade** - Major compatibility upgrade with breaking changes
4+
* Migrated from deprecated `@validator` to `@field_validator` decorators
5+
* Updated `Config` classes to `model_config` with `ConfigDict`
6+
* Replaced `.dict()` method calls with `.model_dump()` throughout codebase
7+
* Changed `JSON` field type to `Dict[str, Any]` for better type safety
8+
* Updated `order_id` field to string type for consistency across models
9+
* Removed deprecated `__fields__` and `underscore_attrs_are_private` attributes
10+
* Updated default `OrderLock` PrivateAttr initialization
11+
12+
### Features
13+
* Full Pydantic v2 compatibility with enhanced validation capabilities
14+
* Improved type hints with `Dict` instead of `defaultdict` imports
15+
* Enhanced error handling with `ValueError` instead of `TypeError` in custom validators
16+
* Better support for Optional fields with default None values
17+
* Updated `breeze-connect` dependency version for Pydantic 2.x compatibility
18+
19+
### Improvements
20+
* `arbitrary_types_allowed=True` added to ConfigDict for pendulum DateTime compatibility
21+
* Fixed validator method signatures for Pydantic v2 strict validation
22+
* Enhanced model configuration with modern Pydantic patterns
23+
* All 149 simulation tests passing with zero warnings
24+
* Maintained full backward compatibility while upgrading to Pydantic v2
25+
26+
### Fixes
27+
* Eliminated all `pydantic_core._pydantic_core.ValidationError` across entire codebase
28+
* Fixed validation errors in order management, multi-user system, candlestick models, and straddle algorithms
29+
* Updated all model definitions, test files, and deprecated method calls
30+
* Fixed Optional field validation with proper default values
31+
132
### 0.19.1
233
### Fixes
334
* Same memory id for `PegExisting` order. See #21

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "omspy"
3-
version = "0.19.1"
3+
version = "0.20.0"
44
description = ""
55
license = "MIT"
66
authors = ["Ubermensch <[email protected]>"]

0 commit comments

Comments
 (0)