diff --git a/.changes/unreleased/Under the Hood-20230912-161509.yaml b/.changes/unreleased/Under the Hood-20230912-161509.yaml new file mode 100644 index 0000000000..369456bcc4 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20230912-161509.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: A simple update to make the where filter query parameter objects more accurate +time: 2023-09-12T16:15:09.057779-05:00 +custom: + Author: DevonFulcher + Issue: None diff --git a/metricflow/specs/where_filter_entity.py b/metricflow/specs/where_filter_entity.py index 5631fb669e..83c983fd39 100644 --- a/metricflow/specs/where_filter_entity.py +++ b/metricflow/specs/where_filter_entity.py @@ -12,28 +12,20 @@ from typing_extensions import override from metricflow.specs.column_assoc import ColumnAssociationResolver -from metricflow.specs.query_interface import QueryInterfaceDimension, QueryInterfaceEntityFactory +from metricflow.specs.query_interface import QueryInterfaceEntity, QueryInterfaceEntityFactory from metricflow.specs.specs import EntitySpec -class WhereFilterEntity(ProtocolHint[QueryInterfaceDimension]): +class WhereFilterEntity(ProtocolHint[QueryInterfaceEntity]): """An entity that is passed in through the where filter parameter.""" @override - def _implements_protocol(self) -> QueryInterfaceDimension: + def _implements_protocol(self) -> QueryInterfaceEntity: return self def __init__(self, column_name: str): # noqa self.column_name = column_name - def grain(self, _grain: str) -> WhereFilterEntity: - """The time granularity.""" - raise NotImplementedError - - def alias(self, _alias: str) -> WhereFilterEntity: - """Renaming the column.""" - raise NotImplementedError - def __str__(self) -> str: """Returns the column name. diff --git a/metricflow/specs/where_filter_time_dimension.py b/metricflow/specs/where_filter_time_dimension.py index 18ed235a81..9ad0bb1826 100644 --- a/metricflow/specs/where_filter_time_dimension.py +++ b/metricflow/specs/where_filter_time_dimension.py @@ -10,28 +10,20 @@ from typing_extensions import override from metricflow.specs.column_assoc import ColumnAssociationResolver -from metricflow.specs.query_interface import QueryInterfaceDimension, QueryInterfaceTimeDimensionFactory +from metricflow.specs.query_interface import QueryInterfaceTimeDimension, QueryInterfaceTimeDimensionFactory from metricflow.specs.specs import TimeDimensionSpec -class WhereFilterTimeDimension(ProtocolHint[QueryInterfaceDimension]): +class WhereFilterTimeDimension(ProtocolHint[QueryInterfaceTimeDimension]): """A time dimension that is passed in through the where filter parameter.""" @override - def _implements_protocol(self) -> QueryInterfaceDimension: + def _implements_protocol(self) -> QueryInterfaceTimeDimension: return self def __init__(self, column_name: str): # noqa self.column_name = column_name - def grain(self, _grain: str) -> WhereFilterTimeDimension: - """The time granularity.""" - raise NotImplementedError - - def alias(self, _alias: str) -> WhereFilterTimeDimension: - """Renaming the column.""" - raise NotImplementedError - def __str__(self) -> str: """Returns the column name.