Skip to content

Pydantic V2 Deprecation Warnings in snowflake.core Generated Models #163

@nickmuoh

Description

@nickmuoh

The snowflake.core package contains auto-generated model files that use deprecated Pydantic V1-style class-based config, triggering numerous PydanticDeprecatedSince20 warnings when imported:

PydanticDeprecatedSince20: Support for class-based `config` is deprecated, use ConfigDict instead. 
Deprecated in Pydantic V2.0 to be removed in V3.0.

Affected Files:

  • snowflake/core/warehouse/_generated/models/warehouse.py
  • snowflake/core/user/_generated/models/*.py
  • snowflake/core/session/_generated/models/*.py
  • And many other _generated model files

Issue:

  1. These warnings flood logs during normal usage, making it difficult to spot legitimate warnings
  2. Standard PYTHONWARNINGS environment variable filters cannot suppress these warnings because Pydantic uses a custom warning class (PydanticDeprecatedSince20) that doesn't respond to standard Python warning filters
  3. Since these are auto-generated files in a distributed package, end users cannot fix them

Request:
Please update the code generator to emit Pydantic V2-compatible models using ConfigDict instead of class-based config. This will eliminate the warnings and ensure compatibility when Pydantic V3 is released.

Migration Reference: https://errors.pydantic.dev/2.12/migration/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions