From a374894ba383532b857e7ea7e756eaee026e757e Mon Sep 17 00:00:00 2001 From: Devon Fulcher Date: Wed, 20 Sep 2023 15:22:22 -0500 Subject: [PATCH] fixed linter & formatter --- .../parsing/where_filter/where_filter_dimension.py | 11 +++++------ .../parsing/where_filter/where_filter_entity.py | 2 +- .../parsing/where_filter/where_filter_parser.py | 4 ++-- .../where_filter/where_filter_time_dimension.py | 2 +- dbt_semantic_interfaces/protocols/query_interface.py | 2 +- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dbt_semantic_interfaces/parsing/where_filter/where_filter_dimension.py b/dbt_semantic_interfaces/parsing/where_filter/where_filter_dimension.py index f6b508af..4a873cca 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_dimension.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_dimension.py @@ -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]): @@ -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 @@ -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: diff --git a/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py b/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py index 62ba32c9..83e5fe8c 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py @@ -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]): diff --git a/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py b/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py index f8a9db9e..0303572a 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py @@ -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, ) ) diff --git a/dbt_semantic_interfaces/parsing/where_filter/where_filter_time_dimension.py b/dbt_semantic_interfaces/parsing/where_filter/where_filter_time_dimension.py index 2873b8e5..3da96607 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_time_dimension.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_time_dimension.py @@ -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]): diff --git a/dbt_semantic_interfaces/protocols/query_interface.py b/dbt_semantic_interfaces/protocols/query_interface.py index bacc2fa1..8cc6db4a 100644 --- a/dbt_semantic_interfaces/protocols/query_interface.py +++ b/dbt_semantic_interfaces/protocols/query_interface.py @@ -1,6 +1,6 @@ from __future__ import annotations -from abc import abstractmethod +from abc import abstractmethod from typing import Protocol, Sequence