diff --git a/pyproject.toml b/pyproject.toml index 5bae412..e6191eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ classifiers = [ [tool.poetry] name = "tidal_algorithmic_mixes" -version = "0.0.4" +version = "0.0.5" description = "common transformers used by the tidal personalization team." authors = [ "Loay ", diff --git a/test/discovery_mix/test_observed_tracks_aggregator.py b/test/discovery_mix/test_observed_tracks_aggregator.py index d3c1929..7f5c081 100644 --- a/test/discovery_mix/test_observed_tracks_aggregator.py +++ b/test/discovery_mix/test_observed_tracks_aggregator.py @@ -47,7 +47,7 @@ def test_transform(self): runner._data = ObservedDiscoveryMixTracksAggregatorTransformationData(observed_mixes=observed_mixes, mixes=mixes) runner.transform() - res = runner.output.output + res = runner.output.df self.assertEqual(res.columns, [c.USER, c.TRACK_GROUP]) self.assertEqual(res.count(), len(tracks_user_1) + len(tracks_user_2)) diff --git a/test/discovery_mix/test_post_processor.py b/test/discovery_mix/test_post_processor.py index 74bca47..8f1ed09 100644 --- a/test/discovery_mix/test_post_processor.py +++ b/test/discovery_mix/test_post_processor.py @@ -136,6 +136,6 @@ def test_transform(self): min_mix_size=0) post_processor._data = self.data post_processor.transform() - res = post_processor.output.output.collect()[0] + res = post_processor.output.df.collect()[0] self.assertEqual(Row(user=1, tracks=['xxx'], mixId='1f1451b3b417516e9e4b4423958', atDate=res.atDate), res) diff --git a/tidal_algorithmic_mixes/discovery_mix/daily_update_transformation.py b/tidal_algorithmic_mixes/discovery_mix/daily_update_transformation.py index 2067e57..15e6ffc 100644 --- a/tidal_algorithmic_mixes/discovery_mix/daily_update_transformation.py +++ b/tidal_algorithmic_mixes/discovery_mix/daily_update_transformation.py @@ -18,13 +18,13 @@ class DiscoveryMixDailyUpdateTransformationData: @dataclass class DiscoveryMixDailyUpdateTransformationOutput: - output: DataFrame + df: DataFrame class DiscoveryMixDailyUpdateTransformationConfig(Config): def __init__(self, **kwargs): self.current_date = kwargs.get('current_date') - self.mix_size = int(kwargs.get('mix_size', 70)) + self.mix_size = int(kwargs.get('mix_size', 10)) Config.__init__(self, **kwargs) @@ -60,7 +60,7 @@ def transform(self, *args, **kwargs): self.config.mix_size) .withColumn(c.UPDATED, F.lit(mix_utils.updated(time.time()))) .where(F.size(c.TRACKS) >= self.config.mix_size - 2)) - self._output = DiscoveryMixDailyUpdateTransformationOutput(output=discovery_mix) + self._output = DiscoveryMixDailyUpdateTransformationOutput(discovery_mix) def slicer(self, mixes: DataFrame, current_date: date, mix_size: int) -> DataFrame: """ Extract the tracks of the day from the weekly computed list """ diff --git a/tidal_algorithmic_mixes/discovery_mix/observed_tracks_aggregator_transformation.py b/tidal_algorithmic_mixes/discovery_mix/observed_tracks_aggregator_transformation.py index 4a5835c..6ffd15f 100644 --- a/tidal_algorithmic_mixes/discovery_mix/observed_tracks_aggregator_transformation.py +++ b/tidal_algorithmic_mixes/discovery_mix/observed_tracks_aggregator_transformation.py @@ -18,7 +18,7 @@ class ObservedDiscoveryMixTracksAggregatorTransformationData: @dataclass class ObservedDiscoveryMixTracksAggregatorTransformationOutput: - output: DataFrame + df: DataFrame class ObservedDiscoveryMixTracksAggregatorTransformation(ETLModel): diff --git a/tidal_algorithmic_mixes/discovery_mix/post_processor_transformation.py b/tidal_algorithmic_mixes/discovery_mix/post_processor_transformation.py index 024a81f..be77ff6 100644 --- a/tidal_algorithmic_mixes/discovery_mix/post_processor_transformation.py +++ b/tidal_algorithmic_mixes/discovery_mix/post_processor_transformation.py @@ -47,7 +47,7 @@ class DiscoveryMixPostProcessorTransformationData: @dataclass class DiscoveryMixPostProcessorTransformationOutput: - output: DataFrame + df: DataFrame class DiscoveryMixPostProcessorTransformationConfig(Config): diff --git a/tidal_algorithmic_mixes/discovery_mix/sasrec_model_transformation.py b/tidal_algorithmic_mixes/discovery_mix/sasrec_model_transformation.py index 0f78374..659d359 100644 --- a/tidal_algorithmic_mixes/discovery_mix/sasrec_model_transformation.py +++ b/tidal_algorithmic_mixes/discovery_mix/sasrec_model_transformation.py @@ -2,6 +2,7 @@ from dataclasses import dataclass from mlflow.pyfunc.spark_model_cache import SparkModelCache +# noinspection PyProtectedMember from mlflow.tracking.artifact_utils import _download_artifact_from_uri from mlflow.utils.file_utils import TempDir import numpy as np @@ -25,7 +26,7 @@ class DiscoveryMixSasRecModelTransformationData: @dataclass class DiscoveryMixSasRecModelTransformationOutput: - output: DataFrame + df: DataFrame class DiscoveryMixSasRecModelTransformationConfig(Config):