Giter VIP home page Giter VIP logo

metric-config-parser's Introduction

metric-config-parser

This package parses configuration files that are compatible with jetstream and opmon compatible configuration files.

Installation

pip install mozilla-metric-config-parser

metric-config-parser's People

Contributors

m-d-bowerman avatar mikewilli avatar scholtzan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

ncalexan

metric-config-parser's Issues

Support loading metric definitions from Jetstream Outcomes into Mozanalysis

I have a metric here defined in a Jetstream Outcome that is frequently used in experiments.

I use mozanalysis to size. I would like to be able to use the definition directly from the Outcome in my sizing scripts. Something like

from mozanalysis.config import ConfigLoader
metric = ConfigLoader.get_metric(metric_slug="urlbar_search_count", app_name="firefox_desktop", outcome="firefox_suggest")

TypeError when trying to use Metrics Hub with Mozanalysis

I follow the docs here to use a Segment Data Source from Metrics Hub with Mozanalysis, but got a TypeError. I'm not sure what the intended usage is.

Python:

from metric_config_parser.config import ConfigCollection
config_collection = ConfigCollection.from_github_repo("https://github.com/mozilla/metric-hub")
clients_daily = config_collection.get_segment_data_source_definition("clients_daily", app_name="firefox_desktop")

from mozanalysis.segments import Segment
us_clients = Segment(
    name="us_clients",
    data_source=clients_daily,
    select_expr="COALESCE(country = 'US', FALSE)",
)

Error:

TypeError: ("'data_source' must be <class 'mozanalysis.segments.SegmentDataSource'> (got SegmentDataSourceDefinition(name='clients_daily', from_expression='mozdata.telemetry.clients_daily', window_start=0, window_end=0, client_id_column='client_id', submission_date_column='submission_date', default_dataset=None) that is a <class 'metric_config_parser.segment.SegmentDataSourceDefinition'>).", Attribute(name='data_source', default=NOTHING, validator=<instance_of validator for type <class 'mozanalysis.segments.SegmentDataSource'>>, repr=True, eq=True, eq_key=None, order=True, order_key=None, hash=None, init=True, metadata=mappingproxy({}), type=None, converter=None, kw_only=False, inherited=False, on_setattr=None), <class 'mozanalysis.segments.SegmentDataSource'>, SegmentDataSourceDefinition(name='clients_daily', from_expression='mozdata.telemetry.clients_daily', window_start=0, window_end=0, client_id_column='client_id', submission_date_column='submission_date', default_dataset=None))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.