Skip to content

Commit 138e33d

Browse files
committed
Pull request #44: Never use an empty alias
Merge in ISGAPPSEC/cyperf-api-wrapper from fix-empty-alias to main Squashed commit of the following: commit e58ab64af1d64be67ef833436ba99c2c3ca0c13b Author: Tudor Simionescu <tudor.simionescu@keysight.com> Date: Wed Nov 12 13:15:59 2025 +0200 Never use an empty alias Why: - if the field.alias property is empty, then we should use the key name; the current code sets the field name to "None"
1 parent 4a7ecea commit 138e33d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cyperf/dynamic_model_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def update(cls, self):
381381
del d[key]
382382
else:
383383
field = self.base_model.__fields__[key]
384-
field_name = field.alias if 'alias' in dir(field) else key
384+
field_name = field.alias if 'alias' in dir(field) and field.alias else key
385385
if field_name != key:
386386
del d[key]
387387
d[field_name] = getattr(self.base_model, key)

0 commit comments

Comments
 (0)