You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We decided on using Uppercase names for entities, so we have attributes like Business Region. If such an Attribute is added with a Prefix, we get Prefix business Region because mara_schema.attributes.Attribute.prefixed_name(...) will lowercase the first char in a name if and all path elements if it is prefixed: https://github.com/mara/mara-schema/blob/master/mara_schema/attribute.py#L54-L55
It would be nice if this could be configured/patchable. I'm currently patching the whole prefixed_name() function but because this is a method and not a function, the normal @patch() doesn't work :-(
# Overwrite the lowercasing of entity names after a prefix# Can't use patch, but simply assigning works :-)def_prefixed_name(self, path: t.Tuple['EntityLink'] =None) ->str:
"""Generate a meaningful business name by concatenating the prefix of entity link instances and original name of attribute. """frommara_schema.attributeimportnormalize_nameifpath:
prefix=' '.join([entity_link.prefixforentity_linkinpath])
returnnormalize_name(prefix+' '+self.name)
else:
returnnormalize_name(self.name)
mara_schema.attribute.Attribute.prefixed_name=_prefixed_name
(BTW: seeing this, if would be nice if there could be a best practise guide for namings, so that this doesn't show up later. Especially because metabase has a bug (metabase/metabase#7923 (comment)) which does not allow for renaming only the casing of an already ingested column, which totally screws up the schema sync in mara-metabase in such cases :-()
The text was updated successfully, but these errors were encountered:
We decided on using Uppercase names for entities, so we have attributes like
Business Region
. If such an Attribute is added with a Prefix, we getPrefix business Region
becausemara_schema.attributes.Attribute.prefixed_name(...)
will lowercase the first char in a name if and all path elements if it is prefixed: https://github.com/mara/mara-schema/blob/master/mara_schema/attribute.py#L54-L55It would be nice if this could be configured/patchable. I'm currently patching the whole
prefixed_name()
function but because this is a method and not a function, the normal@patch()
doesn't work :-((BTW: seeing this, if would be nice if there could be a best practise guide for namings, so that this doesn't show up later. Especially because metabase has a bug (metabase/metabase#7923 (comment)) which does not allow for renaming only the casing of an already ingested column, which totally screws up the schema sync in mara-metabase in such cases :-()
The text was updated successfully, but these errors were encountered: