Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_trending_challenge_should_update(app):
rank=1,
id="1",
type="tracks",
version="pnagD",
version="AnlGe",
week="2021-08-20",
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_index_trending_notification(app):
{
"track_id": i,
"score": 100 - i,
"version": TrendingVersion.pnagD.value,
"version": TrendingVersion.AnlGe.value,
"time_range": "week",
"type": TrendingType.TRACKS.name,
}
Expand Down Expand Up @@ -100,7 +100,7 @@ def test_index_trending_notification(app):
{
"track_id": track_id,
"score": 100 - i,
"version": TrendingVersion.pnagD.value,
"version": TrendingVersion.AnlGe.value,
"time_range": "week",
"type": TrendingType.TRACKS.name,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_index_trending_underground_notification(app):
{
"track_id": i,
"score": 1000 - i,
"version": TrendingVersion.pnagD.value,
"version": TrendingVersion.AnlGe.value,
"time_range": "week",
"type": TrendingType.TRACKS.name,
}
Expand Down Expand Up @@ -101,7 +101,7 @@ def test_index_trending_underground_notification(app):
{
"track_id": track_id,
"score": 1000 - i,
"version": TrendingVersion.pnagD.value,
"version": TrendingVersion.AnlGe.value,
"time_range": "week",
"type": TrendingType.TRACKS.name,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from src.models.social.aggregate_interval_plays import t_aggregate_interval_plays
from src.models.tracks.track_trending_score import TrackTrendingScore
from src.models.tracks.trending_param import t_trending_params
from src.trending_strategies.pnagD_trending_tracks_strategy import (
TrendingTracksStrategypnagD,
from src.trending_strategies.AnlGe_trending_tracks_strategy import (
TrendingTracksStrategyAnlGe,
)
from src.utils.db_session import get_db

Expand Down Expand Up @@ -341,7 +341,7 @@ def test_update_track_score_query(app):

# setup
setup_trending(db)
updated_strategy = TrendingTracksStrategypnagD()
updated_strategy = TrendingTracksStrategyAnlGe()

with db.scoped_session() as session:
session.execute("REFRESH MATERIALIZED VIEW aggregate_interval_plays")
Expand Down
2 changes: 1 addition & 1 deletion packages/discovery-provider/integration_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def populate_mock_db(db, entities, block_offset=None):
track_id=track_trending_score.get("track_id", i),
type=track_trending_score.get("type", TrendingType.TRACKS.name),
score=track_trending_score.get("score", 0),
version=track_trending_score.get("version", TrendingVersion.pnagD.name),
version=track_trending_score.get("version", TrendingVersion.AnlGe.name),
genre=track_trending_score.get("genre", ""),
time_range=track_trending_score.get("time_range", "week"),
created_at=track_trending_score.get("created_at", datetime.now()),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
from src.trending_strategies.pnagD_trending_playlists_strategy import (
TrendingPlaylistsStrategypnagD,
)
from src.trending_strategies.pnagD_trending_tracks_strategy import (
TrendingTracksStrategypnagD,
)
from src.trending_strategies.trending_type_and_version import (
TrendingType,
TrendingVersion,
)

DEFAULT_TRENDING_VERSIONS = {
TrendingType.TRACKS: TrendingVersion.pnagD,
TrendingType.UNDERGROUND_TRACKS: TrendingVersion.pnagD,
TrendingType.TRACKS: TrendingVersion.AnlGe,
TrendingType.UNDERGROUND_TRACKS: TrendingVersion.AnlGe,
TrendingType.PLAYLISTS: TrendingVersion.pnagD,
}

Expand All @@ -23,11 +20,10 @@ class TrendingStrategyFactory:
def __init__(self):
self.strategies = {
TrendingType.TRACKS: {
TrendingVersion.pnagD: TrendingTracksStrategypnagD(),
TrendingVersion.AnlGe: TrendingTracksStrategyAnlGe(),
},
TrendingType.UNDERGROUND_TRACKS: {
TrendingVersion.pnagD: TrendingTracksStrategypnagD(),
TrendingVersion.AnlGe: TrendingTracksStrategyAnlGe(),
},
TrendingType.PLAYLISTS: {
TrendingVersion.pnagD: TrendingPlaylistsStrategypnagD(),
Expand Down