Skip to content
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

chore: Add repr function to BadgeMetadata #397

Merged
merged 6 commits into from Nov 2, 2020
Merged

Conversation

dikshathakur3119
Copy link
Contributor

@dikshathakur3119 dikshathakur3119 commented Oct 30, 2020

Signed-off-by: dikshathakur3119 dikshathakur@lyft.com

Summary of Changes

Adding repr() function to BadgeMetadata so that can be used in unit tests to compare two instances of BadgeMetadata
Removed database and schema from BadgeMetadata since that information is not used anywhere

Tests

NA

Documentation

What documentation did you add or modify and why? Add any relevant links then remove this line

CheckList

Make sure you have checked all steps below to ensure a timely review.

  • PR title addresses the issue accurately and concisely. Example: "Updates the version of Flask to v1.0.2"
  • PR includes a summary of changes.
  • PR adds unit tests, updates existing unit tests, OR documents why no test additions or modifications are needed.
  • In case of new functionality, my PR adds documentation that describes how to use it.
    • All the public functions and the classes in the PR contain docstrings that explain what it does
  • PR passes make test

Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
@feng-tao
Copy link
Member

@dikshathakur3119 LGTM, but a different thought: do we need db_name and schema in badge model? It doesn't seem to get used anywhere? @allisonsuarez WDYT?

@allisonsuarez
Copy link
Contributor

allisonsuarez commented Oct 30, 2020

@dikshathakur3119 LGTM, but a different thought: do we need db_name and schema in badge model? It doesn't seem to get used anywhere? @allisonsuarez WDYT?

Yeah I think you are right, I had added it when first writing the BadgeMetadata and wasn't sure if it would be necessary since the badge key doesn't contain any of this information, but since table, column, and dashboard make those connections already i didn't end up needing it in Badge I forgot to remove it 😅

Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
@@ -65,6 +60,11 @@ def __init__(self,
self._node_iter = iter(self.create_nodes())
self._relation_iter = iter(self.create_relation())

def __repr__(self) -> str:
return 'BadgeMetadata({!r}, {!r}, {!r})'.format(self.cluster,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is cluster being used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no it is not but I did not remove it thinking if we want different badge for different clusters. I can remove it though since w e are not storing this info anywhere

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need it given the start_key uri should include cluster field (db://cluster.schema/table?) even if we have different clusters, the uri will be different?

Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
Signed-off-by: dikshathakur3119 <dikshathakur@lyft.com>
@dikshathakur3119 dikshathakur3119 merged commit 052ce5d into master Nov 2, 2020
@feng-tao feng-tao deleted the diksha-badge branch December 5, 2020 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants