Last active
August 19, 2016 15:40
-
-
Save vitillo/f1129de59ae649e23220583113493ea8 to your computer and use it in GitHub Desktop.
activePlugins is not an array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# In[1]: | |
from moztelemetry import get_pings | |
get_ipython().magic(u'pylab inline') | |
# In[2]: | |
pings = get_pings(sc, app="Firefox", channel="nightly", submission_date="20160718") | |
# In[3]: | |
def get_active_plugins(x): | |
try: | |
return x["environment"]["addons"]["activePlugins"] | |
except: | |
return [] | |
# In[4]: | |
print pings.map(get_active_plugins).filter(lambda x: not isinstance(x, list)).first() | |
# In[5]: | |
print pings.map(get_active_plugins).map(lambda x: (isinstance(x, list), 1)).countByKey() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment