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 331e3398..b6b66784 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_entity.py @@ -16,7 +16,11 @@ class EntityStub(ProtocolHint[QueryInterfaceEntity]): - """An Entity implementation that does nothing.""" + """An Entity implementation that does nothing to satisfy the protocol. + + QueryInterfaceEntity currently has no methods and the parameter set is created in the factory. + So, there is nothing to do here. + """ @override def _implements_protocol(self) -> 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 e1767252..f8a9db9e 100644 --- a/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py +++ b/dbt_semantic_interfaces/parsing/where_filter/where_filter_parser.py @@ -42,7 +42,11 @@ def parse_call_parameter_sets(where_sql_template: str) -> FilterCallParameterSet except (UndefinedError, TemplateSyntaxError, SecurityError) as e: raise ParseWhereFilterException(f"Error while parsing Jinja template:\n{where_sql_template}") from e - dimension_parameter_sets = [] + """ + Dimensions that are created with a grain parameter, Dimension(...).grain(...), are + added to time_dimension_call_parameter_sets otherwise they are add to dimension_call_parameter_sets + """ + dimension_call_parameter_sets = [] for dimension in dimension_factory.created: if dimension.time_granularity: time_dimension_factory.time_dimension_call_parameter_sets.append( @@ -53,12 +57,12 @@ def parse_call_parameter_sets(where_sql_template: str) -> FilterCallParameterSet ) ) else: - dimension_parameter_sets.append( + dimension_call_parameter_sets.append( ParameterSetFactory.create_dimension(dimension.name, dimension.entity_path) ) return FilterCallParameterSets( - dimension_call_parameter_sets=tuple(dimension_parameter_sets), + dimension_call_parameter_sets=tuple(dimension_call_parameter_sets), time_dimension_call_parameter_sets=tuple(time_dimension_factory.time_dimension_call_parameter_sets), entity_call_parameter_sets=tuple(entity_factory.entity_call_parameter_sets), ) 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 f8880d16..54ac8a2c 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 @@ -16,7 +16,11 @@ class TimeDimensionStub(ProtocolHint[QueryInterfaceTimeDimension]): - """A TimeDimension implementation that does nothing.""" + """A TimeDimension implementation that does nothing to satisfy the protocol. + + QueryInterfaceTimeDimension currently has no methods and the parameter set is created in the factory. + So, there is nothing to do here. + """ @override def _implements_protocol(self) -> QueryInterfaceTimeDimension: