Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DevonFulcher committed Sep 20, 2023
1 parent e3ef46c commit 3d7f5fe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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),
)
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3d7f5fe

Please sign in to comment.