Skip to content
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

Resolve linting issue #444

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ To be released at some future point in time

Description

- Resolve a linting issue with pybind-to-python error propagation
- Use mutable fields to enable Dataset get methods that store memory to be marked const

Detailed Notes

- Resolve a linting issue with pybind-to-python error propagation by changing import format and narrowing the lookup of pybind error names to the error module (PR444_)
- Use mutable fields to enable Dataset get methods that store memory to be marked const (PR443_)

.. _PR444: https://github.com/CrayLabs/SmartRedis/pull/444
.. _PR443: https://github.com/CrayLabs/SmartRedis/pull/443

0.5.0
Expand Down
5 changes: 3 additions & 2 deletions src/python/module/smartredis/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
from functools import wraps

import numpy as np
from .error import * # pylint: disable=wildcard-import,unused-wildcard-import
from . import error
#from .error import * # pylint: disable=wildcard-import,unused-wildcard-import
billschereriii marked this conversation as resolved.
Show resolved Hide resolved

from .smartredisPy import RedisReplyError as PybindRedisReplyError
from .smartredisPy import c_get_last_error_location
Expand Down Expand Up @@ -152,7 +153,7 @@ def smartredis_api_wrapper(*args: "_PR.args", **kwargs: "_PR.kwargs") -> "_RT":
cpp_error_str = (
f"File {error_loc}, in SmartRedis library\n{str(cpp_error)}"
)
raise globals()[exception_name](cpp_error_str, method_name) from None
raise getattr(error, exception_name)(cpp_error_str, method_name) from None

return smartredis_api_wrapper

Expand Down
Loading