From 7f6b2e7442adcf0763fe768a953c2acbd03ac03f Mon Sep 17 00:00:00 2001 From: Victor Ng Date: Wed, 8 Aug 2018 11:45:55 -0400 Subject: [PATCH] missed an argument when instantiating the LazyJSONLoader not caught during unittests as the JSON loader itself is clobbered by a mock --- setup.py | 2 +- taar/recommenders/ensemble_recommender.py | 2 +- taar/recommenders/locale_recommender.py | 4 +++- taar/recommenders/similarity_recommender.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 87b7178..6e5c15a 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import find_packages, setup setup( name='mozilla-taar3', use_scm_version=False, - version='0.1.1', + version='0.3.1', setup_requires=['setuptools_scm', 'pytest-runner'], tests_require=['pytest'], include_package_data = True, diff --git a/taar/recommenders/ensemble_recommender.py b/taar/recommenders/ensemble_recommender.py index d476911..5cb670f 100644 --- a/taar/recommenders/ensemble_recommender.py +++ b/taar/recommenders/ensemble_recommender.py @@ -19,7 +19,7 @@ class WeightCache: if 'ensemble_weights' in self._ctx: self._weights = self._ctx['ensemble_weights'] else: - self._weights = LazyJSONLoader(ctx, + self._weights = LazyJSONLoader(self._ctx, S3_BUCKET, ENSEMBLE_WEIGHTS) diff --git a/taar/recommenders/locale_recommender.py b/taar/recommenders/locale_recommender.py index 30ae7cb..832d0ad 100644 --- a/taar/recommenders/locale_recommender.py +++ b/taar/recommenders/locale_recommender.py @@ -27,7 +27,9 @@ class LocaleRecommender(AbstractRecommender): if 'locale_mock_data' in self._ctx: self._top_addons_per_locale = self._ctx['locale_mock_data'] else: - self._top_addons_per_locale = LazyJSONLoader(ADDON_LIST_BUCKET, ADDON_LIST_KEY) + self._top_addons_per_locale = LazyJSONLoader(self._ctx, + ADDON_LIST_BUCKET, + ADDON_LIST_KEY) self._init_from_ctx() self.logger = self._ctx[IMozLogging].get_logger('taar') diff --git a/taar/recommenders/similarity_recommender.py b/taar/recommenders/similarity_recommender.py index 6796928..cdb1093 100644 --- a/taar/recommenders/similarity_recommender.py +++ b/taar/recommenders/similarity_recommender.py @@ -44,12 +44,12 @@ class SimilarityRecommender(AbstractRecommender): if 'similarity_donors_pool' in self._ctx: self._donors_pool = self._ctx['similarity_donors_pool'] else: - self._donors_pool = LazyJSONLoader(S3_BUCKET, DONOR_LIST_KEY) + self._donors_pool = LazyJSONLoader(self._ctx, S3_BUCKET, DONOR_LIST_KEY) if 'similarity_lr_curves' in self._ctx: self._lr_curves = self._ctx['similarity_lr_curves'] else: - self._lr_curves = LazyJSONLoader(S3_BUCKET, LR_CURVES_SIMILARITY_TO_PROBABILITY) + self._lr_curves = LazyJSONLoader(self._ctx, S3_BUCKET, LR_CURVES_SIMILARITY_TO_PROBABILITY) self.logger = self._ctx[IMozLogging].get_logger('taar')