Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Sep 18, 2023
2 parents 1015b5f + 9daaeb2 commit 28e3c88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20230912-161509.yaml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 0 additions & 8 deletions metricflow/specs/where_filter_entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ def _implements_protocol(self) -> QueryInterfaceEntity:
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.
Expand Down
18 changes: 3 additions & 15 deletions metricflow/specs/where_filter_time_dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +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 date_part(self, _date_part: str) -> WhereFilterTimeDimension:
"""Requested date_part to extract."""
raise NotImplementedError

def alias(self, _alias: str) -> WhereFilterTimeDimension:
"""Renaming the column."""
raise NotImplementedError

def __str__(self) -> str:
"""Returns the column name.
Expand Down

0 comments on commit 28e3c88

Please sign in to comment.