Skip to content

Commit

Permalink
fix: tests (incremental)
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
  • Loading branch information
aarnphm committed Nov 8, 2022
1 parent 1eec99d commit dfd860a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Expand Up @@ -65,7 +65,6 @@ dependencies = [
"backports.cached-property;python_version<'3.8'",
"backports.shutil_copytree;python_version<'3.8'",
"importlib-metadata;python_version<'3.8'",
"singledispatchmethod;python_version<'3.8'",
]
dynamic = ["version"]

Expand Down
2 changes: 0 additions & 2 deletions src/bentoml/_internal/io_descriptors/image.py
Expand Up @@ -231,8 +231,6 @@ def from_sample(

if LazyType["ext.NpNDArray"]("numpy.ndarray").isinstance(sample):
sample = PIL.Image.fromarray(sample, mode=pilmode)
elif LazyType["PIL.Image.Image"]("PIL.Image.Image").isinstance(sample):
sample = sample
elif isinstance(sample, str):
p = resolve_user_filepath(sample, ctx=None)
try:
Expand Down
10 changes: 1 addition & 9 deletions src/bentoml/_internal/io_descriptors/pandas.py
Expand Up @@ -469,20 +469,12 @@ def _convert_dtype(
return None

def to_spec(self) -> dict[str, t.Any]:
# TODO: support extension dtypes
dtype = None
if self._dtype is not None:
if isinstance(self._dtype, bool):
dtype = self._dtype
else:
dtype = self._dtype.name

return {
"id": self.descriptor_id,
"args": {
"orient": self._orient,
"columns": self._columns,
"dtype": self._convert_dtype(dtype),
"dtype": self._convert_dtype(self._dtype),
"shape": self._shape,
"enforce_dtype": self._enforce_dtype,
"enforce_shape": self._enforce_shape,
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/_internal/io/test_base.py
Expand Up @@ -2,12 +2,15 @@

import typing as t
from typing import TYPE_CHECKING
from bentoml.io import IODescriptor

import pytest

from bentoml.io import IODescriptor

if TYPE_CHECKING:

from typing_extensions import Self

from bentoml._internal.context import InferenceApiContext as Context


Expand Down

0 comments on commit dfd860a

Please sign in to comment.