From a20a2428e62ba0b1e4a02311b080880ce8c92a5b Mon Sep 17 00:00:00 2001 From: James Kebinger Date: Fri, 7 Feb 2025 15:28:49 -0600 Subject: [PATCH 1/3] Remove reference to a protobuf internal class --- prefab_cloud_python/config_resolver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prefab_cloud_python/config_resolver.py b/prefab_cloud_python/config_resolver.py index cf885cb..f4ea386 100644 --- a/prefab_cloud_python/config_resolver.py +++ b/prefab_cloud_python/config_resolver.py @@ -1,12 +1,12 @@ from __future__ import annotations import functools +from collections.abc import Sequence from .read_write_lock import ReadWriteLock from .config_value_unwrapper import ConfigValueUnwrapper from .context import Context from ._internal_logging import InternalLogger import prefab_pb2 as Prefab -import google logger = InternalLogger(__name__) @@ -162,10 +162,10 @@ def matches(self, criterion, value, properties): criterion_value_or_values = ConfigValueUnwrapper.deepest_value( criterion.value_to_match, self.config.key, properties ).unwrap() - if isinstance( - criterion_value_or_values, google._upb._message.RepeatedScalarContainer - ) or isinstance(criterion_value_or_values, list): + + if isinstance(criterion_value_or_values, Sequence) and not isinstance(criterion_value_or_values, (str, bytes)): return str(value) in criterion_value_or_values + return value == criterion_value_or_values def in_segment(self, criterion, properties): From 4c7e9a9bca63886c605311702b4fa5a716cc2612 Mon Sep 17 00:00:00 2001 From: James Kebinger Date: Fri, 7 Feb 2025 15:30:02 -0600 Subject: [PATCH 2/3] Bump version to 0.10.11 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b947cff..7246653 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "prefab-cloud-python" -version = "0.10.10" +version = "0.10.11" description = "Python client for Prefab Feature Flags, Dynamic log levels, and Config as a Service: https://www.prefab.cloud" license = "MIT" authors = ["Michael Berkowitz ", "James Kebinger "] From 130edac92d05dcde65d8ee2cd76ebf0fdb30df75 Mon Sep 17 00:00:00 2001 From: James Kebinger Date: Fri, 7 Feb 2025 15:32:05 -0600 Subject: [PATCH 3/3] reformat --- prefab_cloud_python/config_resolver.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prefab_cloud_python/config_resolver.py b/prefab_cloud_python/config_resolver.py index f4ea386..61ede0a 100644 --- a/prefab_cloud_python/config_resolver.py +++ b/prefab_cloud_python/config_resolver.py @@ -163,7 +163,9 @@ def matches(self, criterion, value, properties): criterion.value_to_match, self.config.key, properties ).unwrap() - if isinstance(criterion_value_or_values, Sequence) and not isinstance(criterion_value_or_values, (str, bytes)): + if isinstance(criterion_value_or_values, Sequence) and not isinstance( + criterion_value_or_values, (str, bytes) + ): return str(value) in criterion_value_or_values return value == criterion_value_or_values