Skip to content

Commit

Permalink
feat: added resource_reports into Table model
Browse files Browse the repository at this point in the history
feat: added resource_reports into Table model
  • Loading branch information
feng-tao authored Jun 24, 2020
2 parents fac6503 + 983e4c2 commit 60b1751
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions amundsen_common/models/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ class Meta:
target = Source
register_as_scheme = True

@attr.s(auto_attribs=True, kw_only=True)
class ResourceReport:
name: str
url: str


class ResourceReportSchema(AttrsSchema):
class Meta:
target = ResourceReport
register_as_scheme = True


# this is a temporary hack to satisfy mypy. Once https://github.com/python/mypy/issues/6136 is resolved, use
# `attr.converters.default_if_none(default=False)`
Expand Down Expand Up @@ -132,6 +143,7 @@ class Table:
owners: List[User] = []
watermarks: List[Watermark] = []
table_writer: Optional[Application] = None
resource_reports: Optional[List[ResourceReport]] = None
last_updated_timestamp: Optional[int] = None
source: Optional[Source] = None
is_view: Optional[bool] = attr.ib(default=None, converter=default_if_none)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Flask==1.1.1
marshmallow==2.15.3
marshmallow-annotations==2.4.0
mypy==0.720
pytest
pytest>=4.6
pytest-cov
pytest-mock
mock

0 comments on commit 60b1751

Please sign in to comment.