Skip to content

Commit

Permalink
fixed linter & formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
DevonFulcher committed Sep 20, 2023
1 parent 804937a commit a374894
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

from typing_extensions import override

from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint
from dbt_semantic_interfaces.protocols.query_interface import (
QueryInterfaceDimension,
QueryInterfaceDimensionFactory,
)
from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint
from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity


class WhereFilterDimension(ProtocolHint[QueryInterfaceDimension]):
Expand All @@ -23,14 +22,14 @@ def __init__( # noqa
self,
name: str,
entity_path: Sequence[str],
):
) -> None:
self.name = name
self.entity_path = entity_path
self.time_granularity: Optional[TimeGranularity] = None
self.time_granularity_name: Optional[str] = None

def grain(self, time_granularity: str) -> QueryInterfaceDimension:
"""The time granularity."""
self.time_granularity = TimeGranularity(time_granularity)
self.time_granularity_name = time_granularity
return self


Expand All @@ -44,7 +43,7 @@ class WhereFilterDimensionFactory(ProtocolHint[QueryInterfaceDimensionFactory]):
def _implements_protocol(self) -> QueryInterfaceDimensionFactory:
return self

def __init__(self): # noqa
def __init__(self) -> None: # noqa
self.created: List[WhereFilterDimension] = []

def create(self, dimension_name: str, entity_path: Sequence[str] = ()) -> WhereFilterDimension:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from dbt_semantic_interfaces.parsing.where_filter.parameter_set_factory import (
ParameterSetFactory,
)
from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint
from dbt_semantic_interfaces.protocols.query_interface import (
QueryInterfaceEntity,
QueryInterfaceEntityFactory,
)
from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint


class EntityStub(ProtocolHint[QueryInterfaceEntity]):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ def parse_call_parameter_sets(where_sql_template: str) -> FilterCallParameterSet
"""
dimension_call_parameter_sets = []
for dimension in dimension_factory.created:
if dimension.time_granularity:
if dimension.time_granularity_name:
time_dimension_factory.time_dimension_call_parameter_sets.append(
ParameterSetFactory.create_time_dimension(
dimension.name,
dimension.time_granularity,
dimension.time_granularity_name,
dimension.entity_path,
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
from dbt_semantic_interfaces.parsing.where_filter.parameter_set_factory import (
ParameterSetFactory,
)
from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint
from dbt_semantic_interfaces.protocols.query_interface import (
QueryInterfaceTimeDimension,
QueryInterfaceTimeDimensionFactory,
)
from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint


class TimeDimensionStub(ProtocolHint[QueryInterfaceTimeDimension]):
Expand Down
2 changes: 1 addition & 1 deletion dbt_semantic_interfaces/protocols/query_interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations
from abc import abstractmethod

from abc import abstractmethod
from typing import Protocol, Sequence


Expand Down

0 comments on commit a374894

Please sign in to comment.