Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMD-2382] Fix empty timestamp for dashboard #2273

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions common/amundsen_common/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,28 @@
from typing import List, Optional

import attr
from marshmallow import fields
from marshmallow3_annotations.ext.attrs import AttrsSchema


class SafeFloat(fields.Field):
def _serialize(self, value, attr, obj, **kwargs):
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 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 All @@ -25,3 +44,5 @@ class DashboardSummarySchema(AttrsSchema):
class Meta:
target = DashboardSummary
register_as_scheme = True

last_successful_run_timestamp = SafeFloat()
2 changes: 1 addition & 1 deletion common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

__version__ = '0.32.0'
__version__ = '0.33.0'


requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements-dev.txt')
Expand Down
Loading