-
Notifications
You must be signed in to change notification settings - Fork 208
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
feat: Make DescriptionMetadata inherit from GraphSerializable #461
feat: Make DescriptionMetadata inherit from GraphSerializable #461
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -117,7 +117,7 @@ def _create_record_iterator(self) -> Iterator[RDSModel]: | |||
|
|||
|
|||
# TODO: this should inherit from ProgrammaticDescription in amundsen-common | |||
class DescriptionMetadata: | |||
class DescriptionMetadata(GraphSerializable): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @youngyjd , @crazy-2020 recently added https://github.com/amundsen-io/amundsendatabuilder/blob/master/databuilder/models/table_serializable.py#L10 to allow databuilder for mysql, could you make it as subclass as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually will let @crazy-2020 comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @feng-tao. I think it's fine to inherit only graph serializable in DescriptionMetadata. rds models do not have a single generic description model used for multiple entities.
@@ -165,10 +179,12 @@ def get_description_id(self) -> str: | |||
else: | |||
return "_" + self.source + "_description" | |||
|
|||
def __repr__(self) -> str: | |||
return f'DescriptionMetadata({self.source!r}, {self.text!r})' | |||
def get_description_default_key(self, start_key: Optional[str]) -> Optional[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this return optional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Junda Yang <[email protected]>
Signed-off-by: Junda Yang <[email protected]>
Signed-off-by: Junda Yang <[email protected]>
c2f0ac5
to
daffa92
Compare
Signed-off-by: Junda Yang <[email protected]>
51eaf4e
to
6ebbe40
Compare
Summary of Changes
Make DescriptionMetadata inherit from GraphSerializable. The change is backward compatible. DescriptionMetadata can still be created along with TableMetadata, ColumnMetadata, or SchemaModel. At the same time, DescriptionMetadata can now created independently, as long as node key, relation start key, relation start label are provided.
Tests
CheckList
Make sure you have checked all steps below to ensure a timely review.
make test