fix: Python 3.14 compatibility for datetime parsing #723
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #706 - Resolves Python 3.14 compatibility warnings from Pydantic v1 datetime parsing.
This PR addresses the
UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greaterwarning that occurs when importing the cohere SDK on Python 3.14.Changes
pydantic.v1.datetime_parseto Pydantic v2'sTypeAdapterforparse_dateandparse_datetimefunctionspyproject.tomlclassifiersImplementation Details
Before (Pydantic v1 - incompatible with Python 3.14)
After (Pydantic v2 TypeAdapter - Python 3.14 compatible)
Testing
Tested on Python 3.14.2:
Compatibility
Generated with Claude Code
Note
Low Risk
Small, localized compatibility change affecting only date/datetime parsing paths under Pydantic v2; low risk beyond potential subtle parsing behavior differences.
Overview
Fixes Python 3.14+ import warnings and datetime parsing under Pydantic v2 by replacing
pydantic.v1.datetime_parseusage with v2TypeAdapter-basedparse_datetime/parse_date, while conditionally suppressing remainingpydantic.v1compatibility warnings on 3.14+.Updates package metadata to advertise support for Python 3.13 and 3.14 via new
pyproject.tomlclassifiers.Written by Cursor Bugbot for commit 5557402. This will update automatically on new commits. Configure here.