From 762595374cc94da9e6d49a68ee88aacde6eb8124 Mon Sep 17 00:00:00 2001 From: dechoma Date: Wed, 24 Jun 2020 16:29:17 +0200 Subject: [PATCH 1/3] extend table model to handle table static reports --- amundsen_common/models/table.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/amundsen_common/models/table.py b/amundsen_common/models/table.py index 55dba54..f2853e0 100644 --- a/amundsen_common/models/table.py +++ b/amundsen_common/models/table.py @@ -99,6 +99,17 @@ class Meta: target = Source register_as_scheme = True +@attr.s(auto_attribs=True, kw_only=True) +class TableReport: + name: str + url: str + + +class TableReportSchema(AttrsSchema): + class Meta: + target = TableReport + 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)` @@ -132,6 +143,7 @@ class Table: owners: List[User] = [] watermarks: List[Watermark] = [] table_writer: Optional[Application] = None + table_reports: Optional[List[TableReport]] = None last_updated_timestamp: Optional[int] = None source: Optional[Source] = None is_view: Optional[bool] = attr.ib(default=None, converter=default_if_none) From 40019893e6b76ba20326da250f583cf659013b9d Mon Sep 17 00:00:00 2001 From: dechoma Date: Wed, 24 Jun 2020 17:03:13 +0200 Subject: [PATCH 2/3] make new attributes name more generic --- amundsen_common/models/table.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/amundsen_common/models/table.py b/amundsen_common/models/table.py index f2853e0..0bc60ca 100644 --- a/amundsen_common/models/table.py +++ b/amundsen_common/models/table.py @@ -100,14 +100,14 @@ class Meta: register_as_scheme = True @attr.s(auto_attribs=True, kw_only=True) -class TableReport: +class ResourceReport: name: str url: str -class TableReportSchema(AttrsSchema): +class ResourceReportSchema(AttrsSchema): class Meta: - target = TableReport + target = ResourceReport register_as_scheme = True @@ -143,7 +143,7 @@ class Table: owners: List[User] = [] watermarks: List[Watermark] = [] table_writer: Optional[Application] = None - table_reports: Optional[List[TableReport]] = 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) From 983e4c28c272fceadf4b34708df3d710ae948473 Mon Sep 17 00:00:00 2001 From: dechoma Date: Wed, 24 Jun 2020 17:35:56 +0200 Subject: [PATCH 3/3] bump up pytest version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5a217ba..e480d4f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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