Skip to content

Commit

Permalink
Fix: Adaptations for Pydantic v2 migration and stricter validation
Browse files Browse the repository at this point in the history
- Updated the display() method to use self.model_config.env_prefix instead of self.Config.env_prefix.
The previous implementation caused an AttributeError because Config is no longer supported in Pydantic v2.

Adjusted the method to align with the new Pydantic v2 configuration approach, which uses model_config for settings validation and customization.
  • Loading branch information
Antonyjin committed Nov 19, 2024
1 parent bf324dc commit 7911a64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aleph/vm/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,9 @@ def display(self) -> str:
else:
attributes[attr] = getattr(self, attr)

return "\n".join(f"{self.Config.env_prefix}{attribute} = {value}" for attribute, value in attributes.items())
return "\n".join(
f"{self.model_config.env_prefix}{attribute} = {value}" for attribute, value in attributes.items()
)

def __init__(
self,
Expand Down

0 comments on commit 7911a64

Please sign in to comment.