Skip to content

Commit eb5f960

Browse files
authored
FFM-6158 Convert non-string attribute values to string (#50)
* FFM-6158 String conversion and type check for target attributes * FFM-6158 Lint * FFM-6158 Bump version for 1.16 release
1 parent 1767da8 commit eb5f960

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

featureflags/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Enver Bisevac"""
44
__email__ = "[email protected]"
5-
__version__ = '1.1.5'
5+
__version__ = '1.1.6'

featureflags/analytics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,9 @@ def _send_data(self) -> None:
160160
target_attributes: List[KeyValue] = []
161161
if not isinstance(unique_target.attributes, Unset):
162162
for key, value in unique_target.attributes.items():
163-
target_attributes.append(KeyValue(key, value))
163+
# Attribute values need to be sent as string to
164+
# ff-server so convert all values to strings.
165+
target_attributes.append(KeyValue(key, str(value)))
164166
td = TargetData(
165167
identifier=unique_target.identifier,
166168
name=unique_target.name,

featureflags/evaluations/auth_target.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Target():
1616
identifier: str
1717
name: Union[Unset, str] = UNSET
1818
anonymous: Union[Unset, bool] = UNSET
19-
attributes: Union[Unset, Dict[str, Any]] = UNSET
19+
attributes: Union[Unset, Dict[str, str]] = UNSET
2020

2121
def to_dict(self) -> Dict[str, Any]:
2222
identifier = self.identifier

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.5
2+
current_version = 1.1.6
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
test_suite="tests",
5757
tests_require=test_requirements,
5858
url="https://github.com/harness/ff-python-server-sdk",
59-
version='1.1.5',
59+
version='1.1.6',
6060
zip_safe=False,
6161
)

0 commit comments

Comments
 (0)