Skip to content

Commit

Permalink
fix(log): Removing log message when event tags are not in use (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliabbasrizvi authored Oct 24, 2019
1 parent bd6ea2e commit b834b1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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

Expand Down
8 changes: 3 additions & 5 deletions optimizely/helpers/event_tag_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b834b1d

Please sign in to comment.