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
Library for parsing jetstream configuration files
License: Mozilla Public License 2.0
Related to mozilla/mozanalysis#187
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")
See jetstream#1623
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))
Metric.data_source is not hashable.
Mozanalysis expects Metric.data_source to be hashable:
@scholtzan could you help? this is not urgent
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.