Skip to content

Commit

Permalink
Remove unused methods (#207)
Browse files Browse the repository at this point in the history
Co-authored-by: Armin Ruech <[email protected]>
  • Loading branch information
lmolkova and arminru authored Sep 28, 2023
1 parent fb0fcaf commit 615bef9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ class StabilityLevel(Enum):
DEPRECATED = 3


def unique_attributes(attributes):
output = []
for x in attributes:
if x.fqn not in [attr.fqn for attr in output]:
output.append(x)
return output


@dataclass
class SemanticAttribute:
fqn: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
from opentelemetry.semconv.model.exceptions import ValidationError
from opentelemetry.semconv.model.semantic_attribute import (
AttributeType,
RequirementLevel,
SemanticAttribute,
unique_attributes,
)
from opentelemetry.semconv.model.unit_member import UnitMember
from opentelemetry.semconv.model.utils import ValidatableYamlNode, validate_id
Expand Down Expand Up @@ -164,35 +162,6 @@ def contains_attribute(self, attr: "SemanticAttribute"):
return True
return False

def all_attributes(self):
return unique_attributes(self.attributes + self.conditional_attributes())

def sampling_attributes(self):
return unique_attributes(
attr for attr in self.attributes if attr.sampling_relevant
)

def required_attributes(self):
return unique_attributes(
attr
for attr in self.attributes
if attr.requirement_level == RequirementLevel.REQUIRED
)

def conditional_attributes(self):
return unique_attributes(
attr
for attr in self.attributes
if attr.requirement_level == RequirementLevel.CONDITIONALLY_REQUIRED
)

def any_of(self):
result = []
for constraint in self.constraints:
if isinstance(constraint, AnyOf):
result.append(constraint)
return result

def has_attribute_constraint(self, attr):
return any(
attribute.equivalent_to(attr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def to_camelcase(name: str, first_upper=False) -> str:

class CodeRenderer:
pattern = f"{{{ID_RE.pattern}}}"
matcher = re.compile(pattern)

parameters: typing.Dict[str, str]
trim_whitespace: bool
Expand Down

0 comments on commit 615bef9

Please sign in to comment.