Skip to content

Commit

Permalink
Fix a unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Ruofei Zou <[email protected]>
  • Loading branch information
ruofeiz-lyft committed Oct 29, 2024
1 parent 4db4706 commit 88e9f79
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions common/amundsen_common/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@

class SafeFloat(fields.Field):
def _serialize(self, value, attr, obj, **kwargs):
if value == '':
if value is None or value == '':
return None
try:
return float(value)
except ValueError:
self.fail('invalid', input=value)

def _deserialize(self, value, attr, data, **kwargs):
if value == '':
if value is None or value == '':
return None
try:
return float(value)
except ValueError:
self.fail('invalid', input=value)


@attr.s(auto_attribs=True, kw_only=True)
class DashboardSummary:
uri: str = attr.ib()
Expand Down

0 comments on commit 88e9f79

Please sign in to comment.