Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Feb 26, 2024
1 parent 345b25d commit 18ad1d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ def _check_attribute(self, prev: SemanticAttribute, problems: list[Problem]):
if prev.stability == StabilityLevel.STABLE:
self._check_attribute_type(prev, cur, problems)

if isinstance(prev.attr_type, EnumAttributeType):
if (
isinstance(prev.attr_type, EnumAttributeType)
and
# this makes mypy happy, we already checked that type is the same for stable attributes
isinstance(cur.attr_type, EnumAttributeType)
):
for member in prev.attr_type.members:
self._check_member(prev.fqn, member, cur.attr_type.members, problems)

def _check_stability(
self,
prev: SemanticAttribute,
cur: SemanticAttribute,
prev: StabilityLevel,
cur: StabilityLevel,
signal: str,
fqn: str,
problems: list[Problem],
Expand All @@ -91,7 +96,7 @@ def _check_stability(
)

def _check_attribute_type(
self, prev: EnumAttributeType, cur: EnumAttributeType, problems: list[Problem]
self, prev: SemanticAttribute, cur: SemanticAttribute, problems: list[Problem]
):
if isinstance(prev.attr_type, EnumAttributeType):
if not isinstance(cur.attr_type, EnumAttributeType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def testTypeChanged(self):
]
self.assert_errors(expected_errors, problems)

def testStableEnumTypeChanged(self):
def testEnumTypeChanged(self):
cur = self.parse_semconv("compat/enum_type_changed/vnext.yaml")
prev = self.parse_semconv("compat/enum_type_changed/vprev.yaml")
checker = CompatibilityChecker(cur, prev)
Expand All @@ -154,7 +154,7 @@ def testStableEnumTypeChanged(self):
]
self.assert_errors(expected_errors, problems)

def testStableEnumValueChanged(self):
def testEnumValueChanged(self):
cur = self.parse_semconv("compat/enum_value_changed/vnext.yaml")
prev = self.parse_semconv("compat/enum_value_changed/vprev.yaml")
checker = CompatibilityChecker(cur, prev)
Expand Down

0 comments on commit 18ad1d7

Please sign in to comment.