Created
September 29, 2015 14:24
-
-
Save vitillo/eb121b903cfc901a910b to your computer and use it in GitHub Desktop.
TelemetryEnabled bug
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
{"nbformat_minor": 0, "cells": [{"execution_count": 1, "cell_type": "code", "source": "import ujson as json\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport plotly.plotly as py\n\nfrom moztelemetry import get_pings, get_pings_properties, get_one_ping_per_client, get_clients_history\n\n%pylab inline", "outputs": [{"output_type": "stream", "name": "stdout", "text": "Populating the interactive namespace from numpy and matplotlib\n"}], "metadata": {"scrolled": true, "collapsed": false, "trusted": true}}, {"execution_count": 7, "cell_type": "code", "source": "pings = get_pings(sc, app=\"Firefox\", channel=\"release\", submission_date=\"20150928\", build_id=\"20150917150946\")", "outputs": [], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 8, "cell_type": "code", "source": "def telemetry_enabled(ping):\n return ping.get(\"environment\", {}).get(\"settings\", {}).get(\"telemetryEnabled\", False)", "outputs": [], "metadata": {"collapsed": true, "trusted": true}}, {"execution_count": null, "cell_type": "code", "source": "pings.count()", "outputs": [{"execution_count": 9, "output_type": "execute_result", "data": {"text/plain": "1242836"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}, {"execution_count": 12, "cell_type": "code", "source": "pings.filter(telemetry_enabled).count()", "outputs": [{"execution_count": 12, "output_type": "execute_result", "data": {"text/plain": "1242825"}, "metadata": {}}], "metadata": {"collapsed": false, "trusted": true}}], "nbformat": 4, "metadata": {"kernelspec": {"display_name": "Python 2", "name": "python2", "language": "python"}, "language_info": {"mimetype": "text/x-python", "nbconvert_exporter": "python", "version": "2.7.9", "name": "python", "file_extension": ".py", "pygments_lexer": "ipython2", "codemirror_mode": {"version": 2, "name": "ipython"}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am unable to reproduce these results. I get 0 with telemetry enabled.