Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
courtneyholcomb committed Mar 27, 2024
1 parent 2282db7 commit 5d0c768
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions metricflow/model/semantics/linkable_spec_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def path_key(self) -> ElementPathKey: # noqa: D102
)

@property
def reference(self) -> EntityReference: # noqa: D
def reference(self) -> EntityReference: # noqa: D102
return EntityReference(element_name=self.element_name)


Expand All @@ -114,7 +114,7 @@ class LinkableMetric:
join_path: Tuple[SemanticModelJoinPathElement, ...]

@property
def path_key(self) -> ElementPathKey: # noqa: D
def path_key(self) -> ElementPathKey: # noqa: D102
return ElementPathKey(
element_name=self.element_name,
entity_links=self.entity_links,
Expand All @@ -123,7 +123,7 @@ def path_key(self) -> ElementPathKey: # noqa: D
)

@property
def reference(self) -> MetricReference: # noqa: D
def reference(self) -> MetricReference: # noqa: D102
return MetricReference(element_name=self.element_name)


Expand Down Expand Up @@ -459,7 +459,7 @@ class SemanticModelJoinPath:
path_elements: Tuple[SemanticModelJoinPathElement, ...]

@property
def last_path_element(self) -> SemanticModelJoinPathElement: # noqa: D
def last_path_element(self) -> SemanticModelJoinPathElement: # noqa: D102
assert len(self.path_elements) > 0
return self.path_elements[-1]

Expand Down
14 changes: 7 additions & 7 deletions metricflow/specs/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,40 +245,40 @@ class GroupByMetricSpec(LinkableInstanceSpec, SerializableDataclass):
"""Metric used in group by or where filter."""

@property
def without_first_entity_link(self) -> GroupByMetricSpec: # noqa: D
def without_first_entity_link(self) -> GroupByMetricSpec: # noqa: D102
assert len(self.entity_links) > 0, f"Spec does not have any entity links: {self}"
return GroupByMetricSpec(element_name=self.element_name, entity_links=self.entity_links[1:])

@property
def without_entity_links(self) -> GroupByMetricSpec: # noqa: D
def without_entity_links(self) -> GroupByMetricSpec: # noqa: D102
return GroupByMetricSpec(element_name=self.element_name, entity_links=())

@staticmethod
def from_name(name: str) -> GroupByMetricSpec: # noqa: D
def from_name(name: str) -> GroupByMetricSpec: # noqa: D102
structured_name = StructuredLinkableSpecName.from_name(name)
return GroupByMetricSpec(
entity_links=tuple(EntityReference(idl) for idl in structured_name.entity_link_names),
element_name=structured_name.element_name,
)

def __eq__(self, other: Any) -> bool: # type: ignore[misc] # noqa: D
def __eq__(self, other: Any) -> bool: # type: ignore[misc] # noqa: D105
if not isinstance(other, GroupByMetricSpec):
return False
return self.element_name == other.element_name and self.entity_links == other.entity_links

def __hash__(self) -> int: # noqa: D
def __hash__(self) -> int: # noqa: D105
return hash((self.element_name, self.entity_links))

@property
def reference(self) -> MetricReference: # noqa: D
def reference(self) -> MetricReference: # noqa: D102
return MetricReference(element_name=self.element_name)

@property
@override
def as_spec_set(self) -> InstanceSpecSet:
return InstanceSpecSet(group_by_metric_specs=(self,))

def accept(self, visitor: InstanceSpecVisitor[VisitorOutputT]) -> VisitorOutputT: # noqa: D
def accept(self, visitor: InstanceSpecVisitor[VisitorOutputT]) -> VisitorOutputT: # noqa: D102
return visitor.visit_group_by_metric_spec(self)


Expand Down
4 changes: 2 additions & 2 deletions tests/model/semantics/test_linkable_spec_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test_cyclic_join_manifest( # noqa: D103
)


def test_create_linkable_element_set_from_join_path( # noqa: D
def test_create_linkable_element_set_from_join_path( # noqa: D103
request: FixtureRequest,
mf_test_configuration: MetricFlowTestConfiguration,
simple_model_spec_resolver: ValidLinkableSpecResolver,
Expand All @@ -150,7 +150,7 @@ def test_create_linkable_element_set_from_join_path( # noqa: D
)


def test_create_linkable_element_set_from_join_path_multi_hop( # noqa: D
def test_create_linkable_element_set_from_join_path_multi_hop( # noqa: D103
request: FixtureRequest,
mf_test_configuration: MetricFlowTestConfiguration,
simple_model_spec_resolver: ValidLinkableSpecResolver,
Expand Down

0 comments on commit 5d0c768

Please sign in to comment.