Skip to content

Commit

Permalink
fix: support python 3.10, 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
JGrothoff committed Nov 28, 2024
1 parent 7986c4e commit 5cdd540
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pdf2aas/generator/aas_technical_data_submodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def _create_aas_property_smc(
None,
),
)
except AASConstraintViolation as error:
except AASConstraintViolation as error: # noqa: PERF203
logger.warning(
"Couldn't add %s item to property %s: %s",
type(value),
Expand Down
6 changes: 3 additions & 3 deletions src/pdf2aas/model/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ def to_legacy_dict(self) -> dict[str, str | None]:
"name": self.definition_name,
}

@classmethod
def from_dict(cls, property_dict: dict) -> Self:
@staticmethod
def from_dict(property_dict: dict) -> "Property":
"""Parse a Property from a dictionary."""
label = property_dict.get("property")
if label is None:
label = property_dict.get("label")
if label is None:
label = ""

return cls(
return Property(
label,
property_dict.get("value"),
property_dict.get("unit"),
Expand Down
2 changes: 1 addition & 1 deletion tests/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setup_method(self) -> None:
def test_reset(self):
self.g.add_properties(test_property_list)
self.g.reset()
assert self.g.dumps() == f'"{'";"'.join(CSV.header)}"\n'
assert self.g.dumps() == ('"' +'";"'.join(CSV.header) + '"\n')
def test_dumps(self):
self.g.add_properties(test_property_list)
with(open('tests/assets/dummy-result.csv') as file):
Expand Down

0 comments on commit 5cdd540

Please sign in to comment.