Skip to content

Commit

Permalink
feat: Add schema programmatic description relationship in schema model (
Browse files Browse the repository at this point in the history
#10)

* put RDSModel into __all__

Signed-off-by: xuans <[email protected]>

* Add schema_programmatic_descriptions relationship

Signed-off-by: xuans <[email protected]>

* Fix attr name typo in updated_timestamp

Signed-off-by: xuans <[email protected]>
  • Loading branch information
xuan616 authored Mar 16, 2021
1 parent 86437a7 commit 18adfe8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
28 changes: 13 additions & 15 deletions amundsen_rds/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,19 @@
from amundsen_rds.models.updated_timestamp import UpdatedTimestamp
from amundsen_rds.models.user import User

__all__ = [
'Application', 'ApplicationTable', 'Badge', 'Cluster',
'TableColumn', 'ColumnBadge', 'ColumnDescription', 'ColumnStat',
'Dashboard', 'DashboardBadge', 'DashboardChart', 'DashboardCluster',
'DashboardDescription', 'DashboardExecution', 'DashboardFollower', 'DashboardGroup',
'DashboardGroupDescription', 'DashboardOwner', 'DashboardQuery', 'DashboardTable',
'DashboardTag', 'DashboardTimestamp', 'DashboardUsage', 'Database',
'Schema', 'SchemaDescription', 'SchemaProgrammaticDescription', 'Table',
'TableBadge', 'TableDescription', 'TableFollower', 'TableOwner',
'TableProgrammaticDescription', 'TableSource', 'TableTag', 'TableTimestamp',
'TableUsage', 'TableWatermark', 'Tag', 'UpdatedTimestamp',
'User'
]
RDSModel = Union[Application, ApplicationTable, Badge, Cluster,
TableColumn, ColumnBadge, ColumnDescription, ColumnStat,
Dashboard, DashboardBadge, DashboardChart, DashboardCluster,
DashboardDescription, DashboardExecution, DashboardFollower, DashboardGroup,
DashboardGroupDescription, DashboardOwner, DashboardQuery, DashboardTable,
DashboardTag, DashboardTimestamp, DashboardUsage, Database,
Schema, SchemaDescription, SchemaProgrammaticDescription, Table,
TableBadge, TableDescription, TableFollower, TableOwner,
TableProgrammaticDescription, TableSource, TableTag, TableTimestamp,
TableUsage, TableWatermark, Tag, UpdatedTimestamp,
User]

RDSModel = Union[
__all__ = [
'Application', 'ApplicationTable', 'Badge', 'Cluster',
'TableColumn', 'ColumnBadge', 'ColumnDescription', 'ColumnStat',
'Dashboard', 'DashboardBadge', 'DashboardChart', 'DashboardCluster',
Expand All @@ -52,5 +50,5 @@
'TableBadge', 'TableDescription', 'TableFollower', 'TableOwner',
'TableProgrammaticDescription', 'TableSource', 'TableTag', 'TableTimestamp',
'TableUsage', 'TableWatermark', 'Tag', 'UpdatedTimestamp',
'User'
'User', 'RDSModel'
]
2 changes: 2 additions & 0 deletions amundsen_rds/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Schema(Base):

cluster = relationship('Cluster')
description = relationship('SchemaDescription', uselist=False)
programmatic_descriptions = relationship('SchemaProgrammaticDescription',
order_by='SchemaProgrammaticDescription.rk')


class SchemaDescription(Base):
Expand Down
2 changes: 1 addition & 1 deletion amundsen_rds/models/updated_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class UpdatedTimestamp(Base):
__tablename__ = 'updated_timestamp'

rk = Column(String(64), primary_key=True)
last_timestamp = Column(Integer, nullable=False)
latest_timestamp = Column(Integer, nullable=False)
published_tag = Column(String(PUBLISHED_TAG_LEN), nullable=False)
publisher_last_updated_epoch_ms = Column(BigInteger, nullable=False)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import find_packages, setup

__version__ = '0.0.2'
__version__ = '0.0.3'


requirements = [
Expand Down

0 comments on commit 18adfe8

Please sign in to comment.