Skip to content

Commit b834b1d

Browse files
fix(log): Removing log message when event tags are not in use (#218)
1 parent bd6ea2e commit b834b1d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Optimizely Python SDK Changelog
22

33
## 3.3.0
4-
October 25th, 2019
4+
October 28th, 2019
55

66
### New Features:
77
* Added support for event batching via the event processor.
@@ -11,6 +11,9 @@ October 25th, 2019
1111
* Users can subscribe to `LogEvent` notification to be notified of whenever a payload consisting of a batch of user events is handed off to the event dispatcher to send to Optimizely's backend.
1212
* Introduced blocking timeout in `PollingConfigManager`. By default, calls to `get_config` will block for maximum of 10 seconds until config is available.
1313

14+
### Bug Fixes:
15+
* Fixed incorrect log message when numeric metric is not used. ([#217](https://github.com/optimizely/python-sdk/pull/217))
16+
1417
## 3.2.0
1518
August 27th, 2019
1619

optimizely/helpers/event_tag_utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,13 @@ def get_numeric_value(event_tags, logger=None):
6767
numeric_metric_value = None
6868

6969
if event_tags is None:
70-
if logger:
71-
logger.log(enums.LogLevels.ERROR, 'Event tags is undefined.')
72-
return
70+
return numeric_metric_value
7371
elif not isinstance(event_tags, dict):
7472
if logger:
7573
logger.log(enums.LogLevels.ERROR, 'Event tags is not a dictionary.')
76-
return
74+
return numeric_metric_value
7775
elif NUMERIC_METRIC_TYPE not in event_tags:
78-
return
76+
return numeric_metric_value
7977
else:
8078
numeric_metric_value = event_tags[NUMERIC_METRIC_TYPE]
8179
try:

0 commit comments

Comments
 (0)