-
Notifications
You must be signed in to change notification settings - Fork 209
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
fix: add csv badges back in Quickstart #418
fix: add csv badges back in Quickstart #418
Conversation
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
…sendatabuilder into jornh-fix-csv-badges Signed-off-by: jornh <[email protected]>
793a4ff
to
64c7164
Compare
@allisonsuarez ready for review. I notice you have started work on an alternative PR - sorry I wasn't able to complete this sooner, so you could have saved some cycles. |
Signed-off-by: jornh <[email protected]>
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.
Left some questions about the changes in table_metadata but overall the functionality should be good
Signed-off-by: jornh <[email protected]>
21c446a
to
ac27aec
Compare
Signed-off-by: jornh <[email protected]>
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! thank you for doing this :)
Signed-off-by: jornh <[email protected]>
Signed-off-by: jornh <[email protected]>
All green again |
databuilder/models/badge.py
Outdated
@@ -18,6 +18,10 @@ def __repr__(self) -> str: | |||
return 'Badge({!r}, {!r})'.format(self.name, | |||
self.category) | |||
|
|||
def __eq__(self, other: Any) -> bool: # type: ignore[override] |
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.
other: Badge
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.
Oh yeah of course! Thanks - currently AFK but will change
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.
Hmm, apart from that it then throws an error
def __eq__(self, other: Badge) -> bool:
E NameError: name 'Badge' is not defined
Apparently the Class itself isn't know at that point - which I find a little strange. So I'm keeping Any
unless you know a trick.
I got rid if the # type: ignore[override]
though 🙂
Oh wait, through this i found out it needs to be other: 'Badge'
and then mypy itself gives the full recommended way:
❯ mypy .
databuilder/models/badge.py:21: error: Argument 1 of "__eq__" is incompatible with supertype "object"; supertype defines the argument type as "object"
databuilder/models/badge.py:21: note: This violates the Liskov substitution principle
databuilder/models/badge.py:21: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
databuilder/models/badge.py:21: note: It is recommended for "__eq__" to work with arbitrary objects, for example:
databuilder/models/badge.py:21: note: def __eq__(self, other: object) -> bool:
databuilder/models/badge.py:21: note: if not isinstance(other, Badge):
databuilder/models/badge.py:21: note: return NotImplemented
databuilder/models/badge.py:21: note: return <logic to compare two Badge instances>
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.
wow that's so useful
Signed-off-by: jornh <[email protected]>
Summary of Changes
Add back badges at
both table andcolumn levels in Quickstart. They were missing since the API change splitting badges and tags introduced as part of metadata and frontend 3.0.0 versionsUpdate: We decided to do the table level handling with what's already merged in #417
Tests
Added testing to CvsTableColumnExtractor of badges at
table andcolumn level.Documentation
N/A
CheckList
Make sure you have checked all steps below to ensure a timely review.
make test