File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,19 +185,17 @@ class ShallowBinary(BaseModel):
185185
186186 loaded_binprovider : InstanceOf ["BinProvider" ] | None = Field (
187187 default = None ,
188- validation_alias = "binprovider" ,
188+ alias = "binprovider" ,
189189 )
190- loaded_abspath : HostBinPath | None = Field (default = None , validation_alias = "abspath" )
191- loaded_version : SemVer | None = Field (default = None , validation_alias = "version" )
192- loaded_sha256 : Sha256 | None = Field (default = None , validation_alias = "sha256" )
190+ loaded_abspath : HostBinPath | None = Field (default = None , alias = "abspath" )
191+ loaded_version : SemVer | None = Field (default = None , alias = "version" )
192+ loaded_sha256 : Sha256 | None = Field (default = None , alias = "sha256" )
193193
194194 def __getattr__ (self , item : str ) -> Any :
195- """Allow accessing fields as attributes by both field name and alias name """
195+ """Allow accessing loaded fields by their alias names. """
196196 for field , meta in type (self ).model_fields .items ():
197197 if meta .alias == item :
198198 return getattr (self , field )
199- if meta .validation_alias == item :
200- return getattr (self , field )
201199 raise AttributeError (item )
202200
203201 def __repr__ (self ) -> str :
You can’t perform that action at this time.
0 commit comments