Skip to content

Commit

Permalink
Temporary support for both methods of dba_cls serialization (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
KonstantAnxiety authored May 22, 2024
1 parent 5b87533 commit 7e9faa8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def dump_dba_cls(self, act: dba_actions.ActionExecuteQuery) -> str:
def load_dba_cls(self, value: str) -> Union[Type[CommonBaseDirectAdapter]]:
mod_name, cls_name = value.rsplit(".", 1)
candidate = next(
filter(lambda clz: clz.__module__ == mod_name and clz.__qualname__ == cls_name, self.allowed_dba_classes),
filter(
lambda clz: clz.__module__ == mod_name and clz.__qualname__ == cls_name or clz.__qualname__ == value,
self.allowed_dba_classes,
), # TODO clz.__qualname__ == value method is deprecated, to be removed someday
None,
)
if candidate is None:
Expand Down

0 comments on commit 7e9faa8

Please sign in to comment.