From aa9bac67193c0d82d2c9e89f75e9bf4def3e98db Mon Sep 17 00:00:00 2001 From: Omer Zuarets Date: Tue, 29 Oct 2024 16:08:52 +0200 Subject: [PATCH] fix use of lstrip to removeprefix --- horizon/data_manager/update_operations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/horizon/data_manager/update_operations.py b/horizon/data_manager/update_operations.py index 86c3c541..9e331b8c 100644 --- a/horizon/data_manager/update_operations.py +++ b/horizon/data_manager/update_operations.py @@ -21,7 +21,7 @@ def _get_operations_for_update_relationship_tuple( ), ) for full_relation, targets in data.items(): - relation = full_relation.lstrip("relation:") + relation = full_relation.removeprefix("relation:") for target_type, target_objects in targets.items(): for target in target_objects: yield InsertOperation( @@ -39,7 +39,7 @@ def _get_operations_for_update_relationship_tuple( def _get_operations_for_update_role_assigment( full_user_key: str, data: JsonableValue ) -> Iterator[AnyOperation]: - user_key = full_user_key.lstrip("user:") + user_key = full_user_key.removeprefix("user:") yield DeleteOperation( fact=Fact( type="role_assignments",