import os QUERIES_PATH = os.path.dirname(__file__) + '/queries' AWS_REGION = os.environ.get('AWS_REGION', 'us-east-1') # Environment setup QA_ENV = 'qa' PROD_ENV = 'prod' ENV = os.environ.get('ENV', PROD_ENV) # Snowflake configuration SNOWFLAKE_USER = f'{ENV.upper()}_GET_PLAYLIST_BATCHES_FROM_SNOWFLAKE_SERVICE_USER' SNOWFLAKE_ROLE = f'{ENV.upper()}_GET_PLAYLIST_BATCHES_FROM_SNOWFLAKE_SERVICE_USER_ROLE' SNOWFLAKE_ACCOUNT = 'delphi.us-east-1' if ENV == PROD_ENV else 'sme-delphi' SNOWFLAKE_WAREHOUSE = f'{ENV.upper()}_ETL_WAREHOUSE' SNOWFLAKE_PRIVATE_KEY_SECRET = (f'{ENV}/' f'get-playlist-batches-from-snowflake/' f'SNOWFLAKE_KEY') # API configuration API_SECRETS = f'{QA_ENV}/insights-playlist-freshness-tests/api-data.json' SPOTIFY = "spotify" INSIGHTS = f'insights_{ENV}' APOLLO = 'apollo' SERVICES = { INSIGHTS: { "base_url": "" }, APOLLO: { "base_url": "https://proxy.apollo.stream" } } # Playlist Freshness configuration FRESHNESS_TIMEOUT = int(os.environ.get('FRESHNESS_TIMEOUT', 15)) # in minutes UPDATE_TIMEOUT = FRESHNESS_TIMEOUT * 60 # in seconds # Master playlist list source (Google Sheet, "anyone with the link" viewer access, # fetched directly via its CSV export endpoint per tab - no credentials needed). PLAYLISTS_SHEET_ID = "1CmeR7F4J1N-7Zba4d4gefgZE01Wx9CvWUGRyxhIVUJo" def _playlists_sheet_tab_csv_url(gid): return f"https://docs.google.com/spreadsheets/d/{PLAYLISTS_SHEET_ID}/export?format=csv&gid={gid}" # One entry per tab of the master sheet; test_playlists_existence.py parametrizes over this. # 'verify_on' names the live API used to double-check "missing from Insights" playlists # before treating them as bugs - None means no such API client exists yet in this framework, # so that source's missing playlists are only logged, not asserted on. PLAYLISTS_SHEET_TABS = [ { "name": "Spotify priority", "csv_url": _playlists_sheet_tab_csv_url("0"), "id_column": "Playlist URI", "store_id": 286, "verify_on": "spotify", }, { "name": "Spotify hourly", "csv_url": _playlists_sheet_tab_csv_url("1437143836"), "id_column": "Playlist URI", "store_id": 286, "verify_on": "spotify", }, { "name": "Apple Music", "csv_url": _playlists_sheet_tab_csv_url("2012144480"), "id_column": "Playlist ID", "store_id": 1, "verify_on": None, }, ]