Skip to content

5.0.1#86

Open
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1
Open

5.0.1#86
rajnandan1 wants to merge 1 commit intomasterfrom
5.0.1

Conversation

@rajnandan1
Copy link
Contributor

Raising PR to github

Copilot AI review requested due to automatic review settings January 16, 2026 09:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the Cashfree Payment Gateway Python SDK from Pydantic v1 to v2, bumping the package version from 4.5.1 to 5.0.1. This is a major dependency upgrade that requires migrating all model configurations and validators to be compatible with Pydantic v2's API.

Changes:

  • Updated Pydantic dependency from >= 1.10.24, < 2 to >= 2.11.7
  • Migrated all Pydantic model configurations from class Config to model_config dict
  • Replaced @validator decorators with @field_validator decorators
  • Updated version strings across multiple configuration files

Reviewed changes

Copilot reviewed 267 out of 268 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
setup.py Updated version to 5.0.1 and pydantic dependency to >= 2.11.7
pyproject.toml Updated package version to 5.0.1
configuration.py Updated SDK package version strings in both files
cashfree_pg/init.py Updated version to 5.0.1
cashfree_pg/models/*.py Migrated 200+ model files from Pydantic v1 to v2 API
cashfree_pg/api_response.py Added comment about Pydantic v2 compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"Python Version: {pyversion}\n"\
"Version of the API: 2023-08-01\n"\
"SDK Package Version: 4.3.10".\
"SDK Package Version: 4.5.1".\
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SDK package version in configuration.py is incorrectly set to 4.5.1 but should be 5.0.1 to match the version being released in setup.py and pyproject.toml.

Copilot uses AI. Check for mistakes.
__properties = ["channel", "upi_id", "upi_redirect_url", "upi_expiry_minutes", "authorize_only", "authorization"]

@validator('channel')
@field_validator('channel')
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @field_validator decorator in Pydantic v2 requires mode parameter. For backward compatibility with v1 behavior, add mode='before'. Example: @field_validator('channel', mode='before')

Copilot uses AI. Check for mistakes.
@@ -17,7 +17,7 @@
import io
import warnings
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'warnings' is not used.

Suggested change
import warnings

Copilot uses AI. Check for mistakes.
@@ -17,7 +17,7 @@
import io
import warnings

from pydantic import validate_arguments, ValidationError
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'ValidationError' is not used.

Suggested change
from pydantic import validate_arguments, ValidationError, Field, StrictStr, StrictBytes
from pydantic import validate_arguments, Field, StrictStr, StrictBytes

Copilot uses AI. Check for mistakes.
@@ -41,10 +41,8 @@
import base64
import hashlib
import hmac
from pydantic import validate_arguments, ValidationError
from typing_extensions import Annotated
from typing import overload, Optional, Union, Awaitable
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'overload' is not used.
Import of 'Awaitable' is not used.

Suggested change
from typing import overload, Optional, Union, Awaitable
from typing import Optional, Union

Copilot uses AI. Check for mistakes.
from aenum import Enum, no_arg


from pydantic import Field
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import of 'Field' is not used.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants