Closed
Bug 1329993
Opened 9 years ago
Closed 8 years ago
heka_message_parser.py _lazyjson() breaks dict.__cmp__
Categories
(Data Platform and Tools :: General, defect, P2)
Data Platform and Tools
General
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: spenrose, Unassigned)
References
Details
_wrap() breaks comparison of Python dictionaries to non-dictionary objects. Working with pings loaded from JSON, you need to compare dictionaries a lot:
def descend(d):
. path = ['environment', 'settings', 'defaultSearchEngineData', 'origin']
. while path:
. key = path.pop(0)
. d = d.get(key)
. blowup = d == 'some string'
This fails due to _lazyjson()'s invocation of getattr():
File "/home/hadoop/anaconda2/lib/python2.7/site-packages/moztelemetry/heka_message_parser.py", line 92, in _wrap
return method(*args[1:], **kwargs)
TypeError: dict.cmp(x,y) requires y to be a 'dict', not a 'str'
Workaround is to test for isinstance(dict, other) before comparing, which may not be obvious to your average bear.
Updated•9 years ago
|
Points: --- → 1
Flags: needinfo?(mdoglio)
Priority: -- → P2
Updated•8 years ago
|
Component: Metrics: Pipeline → Telemetry APIs for Analysis
Product: Cloud Services → Data Platform and Tools
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•3 years ago
|
Component: Telemetry APIs for Analysis → General
You need to log in
before you can comment on or make changes to this bug.
Description
•