Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Conversation

@jinglemansweep
Copy link
Contributor

Replace deprecated class Config with model_config = ConfigDict() in all response model classes to comply with Pydantic V2 standards and eliminate deprecation warnings about removal in V3.

Replace deprecated `class Config` with `model_config = ConfigDict()`
in all response model classes to comply with Pydantic V2 standards
and eliminate deprecation warnings about removal in V3.
Copilot AI review requested due to automatic review settings December 1, 2025 19:15
@jinglemansweep jinglemansweep merged commit 8b3fec6 into main Dec 1, 2025
3 checks passed
@jinglemansweep jinglemansweep deleted the claude/fix-pydantic-warnings-018rCf4z2gWeUeRnDWnGRYTM branch December 1, 2025 19:16
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 migrates Pydantic model configurations from the deprecated V1 class Config pattern to the Pydantic V2 model_config = ConfigDict() pattern, addressing deprecation warnings about removal in Pydantic V3. The changes ensure all response model classes in the API schemas follow modern Pydantic V2 standards.

  • Adds ConfigDict to the Pydantic imports
  • Replaces all class Config: from_attributes = True with model_config = ConfigDict(from_attributes=True) across 6 response model classes
  • Includes an unrelated formatting change to a test query

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/meshcore_api/api/schemas.py Updates all 6 response model classes (NodeResponse, MessageResponse, AdvertisementResponse, TracePathResponse, TelemetryResponse, SignalStrengthResponse) to use Pydantic V2's model_config pattern and adds ConfigDict import
tests/unit/test_signal_strength.py Contains an unrelated formatting change that consolidates a multi-line query into a single line, which is inconsistent with existing patterns in the same file

session.query(SignalStrength)
.filter(SignalStrength.trace_path_id == 100)
.all()
session.query(SignalStrength).filter(SignalStrength.trace_path_id == 100).all()
Copy link

Copilot AI Dec 1, 2025

Choose a reason for hiding this comment

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

This formatting change is unrelated to the PR's purpose of fixing Pydantic deprecation warnings. Additionally, it's inconsistent with the multi-line formatting used for similar queries elsewhere in this file (lines 150-154 and 185-189). Consider reverting this change to maintain consistency with the existing code style, or apply the formatting change consistently across all similar query patterns in the file.

Suggested change
session.query(SignalStrength).filter(SignalStrength.trace_path_id == 100).all()
session.query(SignalStrength)
.filter(SignalStrength.trace_path_id == 100)
.all()

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants