From 3f0ae3368ba68dd6335a93902d4e70250282f51e Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Fri, 3 Nov 2023 00:38:55 -0700 Subject: [PATCH] Warning: get_parameter_value() is deprecated. (#866) Signed-off-by: Tomoya Fujita --- ros2component/ros2component/api/__init__.py | 2 +- ros2param/ros2param/api/__init__.py | 8 -------- ros2param/test/test_api.py | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/ros2component/ros2component/api/__init__.py b/ros2component/ros2component/api/__init__.py index b1ca02b1e..1dcc0140b 100644 --- a/ros2component/ros2component/api/__init__.py +++ b/ros2component/ros2component/api/__init__.py @@ -23,12 +23,12 @@ import rcl_interfaces.msg import rclpy +from rclpy.parameter import get_parameter_value from rclpy.task import Future from ros2cli.node.strategy import NodeStrategy from ros2node.api import get_node_names from ros2node.api import get_service_server_info -from ros2param.api import get_parameter_value from ros2pkg.api import get_executable_paths from ros2pkg.api import PackageNotFound diff --git a/ros2param/ros2param/api/__init__.py b/ros2param/ros2param/api/__init__.py index ef03a2456..7f3180492 100644 --- a/ros2param/ros2param/api/__init__.py +++ b/ros2param/ros2param/api/__init__.py @@ -13,23 +13,15 @@ # limitations under the License. import sys -import warnings from rcl_interfaces.msg import ParameterType import rclpy -from rclpy.parameter import get_parameter_value as rclpy_get_parameter_value from rclpy.parameter import parameter_dict_from_yaml_file from rclpy.parameter import parameter_value_to_python from rclpy.parameter_client import AsyncParameterClient from ros2cli.node.direct import DirectNode -def get_parameter_value(*, string_value): - warnings.warn('get_parameter_value() is deprecated. ' - 'Use rclpy.parameter.get_parameter_value instead') - return rclpy_get_parameter_value(string_value) - - def get_value(*, parameter_value): """Get the value from a ParameterValue.""" value = None diff --git a/ros2param/test/test_api.py b/ros2param/test/test_api.py index 9c42c8a9e..374ec1592 100644 --- a/ros2param/test/test_api.py +++ b/ros2param/test/test_api.py @@ -17,7 +17,7 @@ import pytest from rcl_interfaces.msg import ParameterType -from ros2param.api import get_parameter_value +from rclpy.parameter import get_parameter_value @pytest.mark.parametrize(