Skip to content

adapter.json: Remove duplicate @classmethod#595

Merged
s-heppner merged 1 commit into
eclipse-basyx:developfrom
rwth-iat:Fix/json_deserialization_typo
Jul 15, 2026
Merged

adapter.json: Remove duplicate @classmethod#595
s-heppner merged 1 commit into
eclipse-basyx:developfrom
rwth-iat:Fix/json_deserialization_typo

Conversation

@s-heppner

Copy link
Copy Markdown
Member

Previously, _construct_blob in json_deserialization.py was decorated with @classmethod twice, producing a
classmethod(classmethod(func)) wrapper.

On Python 3.10 and 3.12 (used in CI) this went unnoticed, because classmethod chained through the inner descriptor and still resolved to a callable bound method. Python 3.13 removed that descriptor chaining, so accessing cls._construct_blob now yields a raw, non-callable classmethod object. As a result, deserializing any Blob raised TypeError: 'classmethod' object is not callable, breaking JSON deserialization and the AASX round-trip tests on 3.13.

This change removes the redundant decorator so _construct_blob behaves like all other constructor methods.

This finding motivated #594.

Previously, `_construct_blob` in `json_deserialization.py` was
decorated with `@classmethod` twice, producing a
`classmethod(classmethod(func))` wrapper.

On Python 3.10 and 3.12 (used in CI) this went unnoticed, because
`classmethod` chained through the inner descriptor and still resolved
to a callable bound method. Python 3.13 removed that descriptor
chaining, so accessing `cls._construct_blob` now yields a raw,
non-callable `classmethod` object. As a result, deserializing any
`Blob` raised `TypeError: 'classmethod' object is not callable`,
breaking JSON deserialization and the AASX round-trip tests on 3.13.

This change removes the redundant decorator so `_construct_blob`
behaves like all other constructor methods.

This finding motivated eclipse-basyx#594.
@s-heppner s-heppner requested a review from zrgt July 14, 2026 13:36
@s-heppner s-heppner added this to the Release 2.1.0 milestone Jul 14, 2026

@paul-gerber-svg paul-gerber-svg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@s-heppner s-heppner merged commit 59adfe6 into eclipse-basyx:develop Jul 15, 2026
15 checks passed
@s-heppner s-heppner deleted the Fix/json_deserialization_typo branch July 15, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants