-
Notifications
You must be signed in to change notification settings - Fork 105
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
TVB-2689: add summary_info to DataType indexes #139
Conversation
…n using .column_attrs.keys() and remove 'type'
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.
Good, so far, but see the comments on Jira task
…attributes and "id" for scientific metadata
return ret | ||
|
||
@property | ||
def get_base_table_columns(self): |
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.
if you use name get_...
then leave it a normal method and call with self. get_base_table_columns()
if you make it a @property
, then a better name would have been def base_table_columns(self):
Particularly in this case I would use neither, but a private method (so not a property) def _get_base_table_columns(self):
columns = self.__table__.columns.keys() | ||
if type(self).__bases__[0] is DataType: | ||
return columns | ||
base_table_columns = type(self).__bases__[0].__table__.columns.keys() |
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.
This will go just one level up in inheritance, and not consider multiple inheritance.
Will this be enough for all our use-cases?
columns.extend(base_table_columns) | ||
return columns | ||
|
||
def get_attribute_name(self, attr_name): |
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.
In general a new method is not a bad idea, but in this case, I suggest to inline the code and don't put this part in another method, because the return None
convention is odd and a bit of an antipattern
After the split in multiple layers on datatypes, we no longer had "scientific Details" in a DataType overlay. We need to add something similar with the previous summary_info on DataType indexes.