-
Notifications
You must be signed in to change notification settings - Fork 98
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
Remove unneeded protocols for lookup classes #1137
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.
Huh. That was easier than I thought it would be. See inline about some added method cleanup. Fine to do a separate PR or just layer on a new commit for them, either way. Thanks!
from metricflow.specs.specs import TimeDimensionSpec | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class MetricLookup(MetricAccessor): | ||
class MetricLookup: |
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.
I think the add_metric
method here is the only "write" method in this class, and it's not called anywhere. Mind just renaming it to _add_metric
so we don't have any "write" methods in the public interface?
"""Tracks semantic information for semantic models held in a set of SemanticModelContainers. | ||
|
||
This implements the SemanticModelAccessors protocol, the interface type we use throughout the codebase. | ||
This implements the SemanticModelLookups protocol, the interface type we use throughout the codebase. |
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.
Nit - remove this line and the next, they're outdated.
Description
Deletes protocols used for
SemanticModelLookup
andMetricLookup
in an effort to reduce boilerplate code and improve developer experience when working with these classes. Discussed with @tlento here.Also copies over any missing docstrings from the base classes so that we won't lose that context.