Skip to content

v4.0.0

Choose a tag to compare

@niteshsandal-merge niteshsandal-merge released this 17 Jul 14:50
· 2 commits to main since this release
44aff10

Merge Python SDK Release Notes - Version [4.0.0]

This release upgrades the SDK's code generation, resolves the pydantic v2 deprecation warnings that were polluting customer logs (#117), improves retry and rate-limit handling, and adds optional SDK logging. It also raises the minimum supported Python version to 3.10.

Breaking Changes

Python 3.10 or later is now required. Support for Python 3.8 and 3.9 has been dropped; the package will not install on those interpreters. Projects on 3.8/3.9 must upgrade Python or remain on the 3.x line of the SDK.

# Before
python = "^3.8"
# After
python = "^3.10"

New Features

  • Configurable logging: Merge and AsyncMerge now accept an optional logging parameter (a LogConfig dict or a Logger instance). Logging is silent by default, so existing behavior is unchanged unless you opt in.
from merge import Merge

client = Merge(
    api_key="...",
    account_token="...",
    logging={"level": "debug", "silent": False},
)

Bug Fixes

  • Removed pydantic v2 deprecation warnings (#117). The base model previously used a v1-style configuration (smart_union, allow_population_by_field_name, and class-based Config), which emitted DeprecationWarnings on every model use under pydantic v2 and polluted application logs. The pydantic v2 code path now uses ConfigDict with current keys. No code changes are required — the warnings simply stop.

Behavior Changes

These do not require code changes, but may be observable.

  • Retry backoff now respects rate-limit headers. Retries honor the Retry-After and X-RateLimit-Reset response headers (up to 60 seconds) and use a larger maximum backoff (10s → 60s). This improves handling of 429/5xx responses but can lengthen the worst-case duration of a call that hits repeated retryable errors. The retry count is unchanged (default 2, still configurable via request_options).

  • Enum members stringify to their value on Python 3.11+. Generated enums now derive from StrEnum. On Python 3.11+, str(SomeEnum.MEMBER), f-strings, and format() return the bare value (e.g. "ADMIN") instead of "SomeEnum.ADMIN". Equality with the string value (member == "ADMIN") and data returned from the API are unaffected — this only matters if you stringify an enum member object directly, for example when logging or building display strings. There is no change on Python 3.10.