Skip to content

Commit

Permalink
fix: Update common model to align with databuilder model (#1232)
Browse files Browse the repository at this point in the history
* Bump common

Signed-off-by: Allison Suarez Miranda <[email protected]>

* put back chan ges from main

Signed-off-by: Allison Suarez Miranda <[email protected]>

* more changes back

Signed-off-by: Allison Suarez Miranda <[email protected]>
  • Loading branch information
allisonsuarez authored Jun 15, 2021
1 parent c41323e commit 3bbc466
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
21 changes: 16 additions & 5 deletions common/amundsen_common/models/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from amundsen_common.models.user import User
from amundsen_common.models.badge import Badge
from amundsen_common.models.tag import Tag
from amundsen_common.models.table import Column, ProgrammaticDescription, Watermark
from amundsen_common.models.table import ProgrammaticDescription
from marshmallow3_annotations.ext.attrs import AttrsSchema


Expand Down Expand Up @@ -38,6 +38,19 @@ class Meta:
register_as_scheme = True


@attr.s(auto_attribs=True, kw_only=True)
class FeatureWatermark:
key: Optional[str]
watermark_type: Optional[str]
time: str


class FeatureWatermarkSchema(AttrsSchema):
class Meta:
target = FeatureWatermark
register_as_scheme = True


@attr.s(auto_attribs=True, kw_only=True)
class Feature:
key: Optional[str] = attr.ib(default=None)
Expand All @@ -51,13 +64,11 @@ class Feature:
description: Optional[str] = attr.ib(default=None)
owners: List[User]
badges: List[Badge]
owner_tags: Optional[List[Tag]] # non editable
tags: List[Tag] # editable
tags: List[Tag]
programmatic_descriptions: List[ProgrammaticDescription]
watermarks: List[Watermark]
watermarks: List[FeatureWatermark]
last_updated_timestamp: Optional[int]
created_timestamp: Optional[int]
partition_column: Optional[Column]


class FeatureSchema(AttrsSchema):
Expand Down
18 changes: 18 additions & 0 deletions common/amundsen_common/models/generation_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from typing import Optional

import attr

from marshmallow3_annotations.ext.attrs import AttrsSchema


@attr.s(auto_attribs=True, kw_only=True)
class GenerationCode:
key: Optional[str]
text: str
source: Optional[str]


class GenerationCodeSchema(AttrsSchema):
class Meta:
target = GenerationCode
register_as_scheme = True
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.13.0'
__version__ = '0.14.0'

requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements-common.txt')
with open(requirements_path) as requirements_file:
Expand Down

0 comments on commit 3bbc466

Please sign in to comment.