missed an argument when instantiating the LazyJSONLoader

not caught during unittests as the JSON loader itself is clobbered by a
mock
This commit is contained in:
Victor Ng 2018-08-08 11:45:55 -04:00
Родитель 6b95af983b
Коммит 7f6b2e7442
4 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -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)

Просмотреть файл

@ -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')

Просмотреть файл

@ -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')