Skip to content

Commit b4fc5ae

Browse files
authored
fix: Remove typing (#49)
* remove imports of typing package * remove typing package from setup.py required_packages * fix flake8 violations
1 parent 8162fd7 commit b4fc5ae

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def read_version():
2929

3030
packages = setuptools.find_packages(where="src", exclude=("test",))
3131

32-
required_packages = ["numpy", "six", "typing", "psutil", "retrying==1.3.3"]
32+
required_packages = ["numpy", "six", "psutil", "retrying==1.3.3"]
3333

3434
# enum is introduced in Python 3.4. Installing enum back port
3535
if sys.version_info < (3, 4):

src/sagemaker_inference/decoder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from __future__ import absolute_import
1616

1717
import json
18-
from typing import Iterable # noqa ignore=F401 imported but unused
1918

2019
import numpy as np
2120
from six import BytesIO, StringIO
@@ -79,7 +78,6 @@ def _npy_to_numpy(npy_array): # type: (object) -> np.array
7978

8079

8180
def decode(obj, content_type):
82-
# type: (np.array or Iterable or int or float, str) -> np.array
8381
"""Decode an object to one of the default content types to a numpy array.
8482
8583
Args:

src/sagemaker_inference/encoder.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515
from __future__ import absolute_import
1616

1717
import json
18-
from typing import Iterable # noqa ignore=F401 imported but unused
1918

2019
import numpy as np
2120
from six import BytesIO, StringIO
2221

2322
from sagemaker_inference import content_types, errors
2423

2524

26-
def _array_to_json(array_like): # type: (np.array or Iterable or int or float) -> str
25+
def _array_to_json(array_like):
2726
"""Convert an array-like object to JSON.
2827
2928
To understand better what an array-like object is see:
@@ -45,7 +44,7 @@ def default(_array_like):
4544
return json.dumps(array_like, default=default)
4645

4746

48-
def _array_to_npy(array_like): # type: (np.array or Iterable or int or float) -> object
47+
def _array_to_npy(array_like):
4948
"""Convert an array-like object to the NPY format.
5049
5150
To understand better what an array-like object is see:
@@ -63,7 +62,7 @@ def _array_to_npy(array_like): # type: (np.array or Iterable or int or float) -
6362
return buffer.getvalue()
6463

6564

66-
def _array_to_csv(array_like): # type: (np.array or Iterable or int or float) -> str
65+
def _array_to_csv(array_like):
6766
"""Convert an array-like object to CSV.
6867
6968
To understand better what an array-like object is see:
@@ -89,7 +88,6 @@ def _array_to_csv(array_like): # type: (np.array or Iterable or int or float) -
8988

9089

9190
def encode(array_like, content_type):
92-
# type: (np.array or Iterable or int or float, str) -> np.array
9391
"""Encode an array-like object in a specific content_type to a numpy array.
9492
9593
To understand better what an array-like object is see:

0 commit comments

Comments
 (0)