Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinugu committed Jan 6, 2024
1 parent 397f879 commit 172c4fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/omnipy/data/model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from abc import ABCMeta
from collections.abc import Mapping, Sequence
import functools
import inspect
Expand Down Expand Up @@ -31,7 +32,7 @@

from omnipy.data.methodinfo import MethodInfo, SPECIAL_METHODS_INFO
from omnipy.util.contexts import AttribHolder, LastErrorHolder, nothing
from omnipy.util.decorators import add_callback_after_call, apply_decorator_to_property
from omnipy.util.decorators import add_callback_after_call
from omnipy.util.helpers import (all_equals,
ensure_plain_type,
generate_qualname,
Expand Down Expand Up @@ -110,7 +111,6 @@ class MyModelMetaclass(ModelMetaclass):
# to be set to True so that Model is allowed to validate a None value.
#
# TODO: Revisit the need for MyModelMetaclass hack in pydantic v2

def __instancecheck__(self, instance: Any) -> bool:
if instance is None:
return True
Expand Down
2 changes: 1 addition & 1 deletion src/omnipy/data/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def load_from_tar_file_path_based_on_dataset_cls(self,
serializers = self.detect_tar_file_serializers_from_dataset_cls(to_dataset)
if len(serializers) == 0:
log(f'No serializer for Dataset with type "{type(to_dataset)}" can be '
f'determined. Aborting load.')
f'determined.')
else:
for serializer in serializers:
log(f'Reading dataset from a gzipped tarpack at'
Expand Down
4 changes: 2 additions & 2 deletions src/omnipy/modules/raw/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_output_file_suffix(cls) -> str:
return 'txt'

@classmethod
def serialize(cls, dataset: Dataset[Model[str]]) -> bytes:
def serialize(cls, dataset: Dataset[Model[str]]) -> bytes | memoryview:
def raw_encode_func(contents: str) -> bytes:
return contents.encode('utf8')

Expand Down Expand Up @@ -66,7 +66,7 @@ def get_output_file_suffix(cls) -> str:
return 'bytes'

@classmethod
def serialize(cls, dataset: Dataset[Model[bytes]]) -> bytes:
def serialize(cls, dataset: Dataset[Model[bytes]]) -> bytes | memoryview:
def raw_encode_func(contents: bytes) -> bytes:
return contents

Expand Down

0 comments on commit 172c4fc

Please sign in to comment.