Skip to content

change: correct code per len-as-condition Pylint check #902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sagemaker/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down