From b834b1d1bb91ffa32fc7c502cf6bcf150e977570 Mon Sep 17 00:00:00 2001 From: Ali Abbas Rizvi Date: Thu, 24 Oct 2019 16:20:59 -0700 Subject: [PATCH] fix(log): Removing log message when event tags are not in use (#218) --- CHANGELOG.md | 5 ++++- optimizely/helpers/event_tag_utils.py | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef44b4a7..a3c7b296 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Optimizely Python SDK Changelog ## 3.3.0 -October 25th, 2019 +October 28th, 2019 ### New Features: * Added support for event batching via the event processor. @@ -11,6 +11,9 @@ October 25th, 2019 * 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. * Introduced blocking timeout in `PollingConfigManager`. By default, calls to `get_config` will block for maximum of 10 seconds until config is available. +### Bug Fixes: +* Fixed incorrect log message when numeric metric is not used. ([#217](https://github.com/optimizely/python-sdk/pull/217)) + ## 3.2.0 August 27th, 2019 diff --git a/optimizely/helpers/event_tag_utils.py b/optimizely/helpers/event_tag_utils.py index ab0d90e4..06bd953c 100644 --- a/optimizely/helpers/event_tag_utils.py +++ b/optimizely/helpers/event_tag_utils.py @@ -67,15 +67,13 @@ def get_numeric_value(event_tags, logger=None): numeric_metric_value = None if event_tags is None: - if logger: - logger.log(enums.LogLevels.ERROR, 'Event tags is undefined.') - return + return numeric_metric_value elif not isinstance(event_tags, dict): if logger: logger.log(enums.LogLevels.ERROR, 'Event tags is not a dictionary.') - return + return numeric_metric_value elif NUMERIC_METRIC_TYPE not in event_tags: - return + return numeric_metric_value else: numeric_metric_value = event_tags[NUMERIC_METRIC_TYPE] try: