diff --git a/.pylintrc b/.pylintrc index 5699045bec..c836b5269e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -82,7 +82,7 @@ disable= invalid-name, too-many-instance-attributes, line-too-long, # We let Flake8 take care of this # TODO: Fix these and stop relying on flake8 - len-as-condition, # TODO: Use if seq: and if not seq: instead + len-as-condition, # TODO: Enable this check once pylint 2.4.0 is released and consumed due to the fix in https://github.com/PyCQA/pylint/issues/2684 logging-format-interpolation, # TODO: Fix logging so as to remove this. import-error, # TODO: Fix import errors logging-not-lazy, # TODO: Fix logging diff --git a/src/sagemaker/predictor.py b/src/sagemaker/predictor.py index 9b4f777178..e7d43e1925 100644 --- a/src/sagemaker/predictor.py +++ b/src/sagemaker/predictor.py @@ -195,7 +195,7 @@ def _serialize_row(data): if isinstance(data, np.ndarray): data = np.ndarray.flatten(data) if hasattr(data, "__len__"): - if len(data): + if len(data) > 0: return _csv_serialize_python_array(data) else: raise ValueError("Cannot serialize empty array")