Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Commit

Permalink
Rename column alt_audio_files to alt_files
Browse files Browse the repository at this point in the history
  • Loading branch information
krysal committed Jul 29, 2021
1 parent 9a408f1 commit 27c1ca4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/cc_catalog_airflow/dags/common/storage/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
),
columns.JSONColumn(
# Alternative files: url, filesize, bit_rate, sample_rate
name='alt_audio_files', required=False
name='alt_files', required=False
),
]

Expand Down Expand Up @@ -140,7 +140,7 @@ def add_item(
set_position: Optional[int] = None,
set_thumbnail: Optional[str] = None,
set_url: Optional[str] = None,
alt_audio_files: Optional[Dict] = None,
alt_files: Optional[Dict] = None,
source: Optional[str] = None,
ingestion_type: Optional[str] = None,
):
Expand Down Expand Up @@ -195,7 +195,7 @@ def add_item(
set_position: Position of the audio in the audio_set
set_thumbnail: URL of the audio_set thumbnail
set_url: URL of the audio_set
alt_audio_files: A dictionary with information about alternative
alt_files: A dictionary with information about alternative
files for the audio (different formats/ quality).
Dict with the following keys: url, filesize,
bit_rate, sample_rate
Expand Down Expand Up @@ -234,7 +234,7 @@ def add_item(
'category': category,
'genres': genres,
'audio_set': audio_set_data,
'alt_audio_files': alt_audio_files,
'alt_files': alt_files,
'source': source,
'ingestion_type': ingestion_type,
}
Expand Down
2 changes: 1 addition & 1 deletion src/cc_catalog_airflow/dags/util/loader/column_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
CATEGORY = 'category'
GENRES = 'genres'
AUDIO_SET = 'audio_set'
ALT_AUDIO_FILES = 'alt_audio_files'
ALT_FILES = 'alt_files'
8 changes: 4 additions & 4 deletions src/cc_catalog_airflow/dags/util/loader/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def create_loading_table(
{col.CATEGORY} character varying(100),
{col.GENRES} character varying(80)[],
{col.AUDIO_SET} jsonb,
{col.ALT_AUDIO_FILES} jsonb
{col.ALT_FILES} jsonb
);
'''
)
Expand Down Expand Up @@ -309,7 +309,7 @@ def _merge_array(column: str) -> str:
col.CATEGORY: col.CATEGORY,
col.GENRES: col.GENRES,
col.AUDIO_SET: col.AUDIO_SET,
col.ALT_AUDIO_FILES: col.ALT_AUDIO_FILES,
col.ALT_FILES: col.ALT_FILES,
})
else:
column_inserts.update({
Expand All @@ -324,7 +324,7 @@ def _merge_array(column: str) -> str:
{_newest_non_null(col.CATEGORY)},
{_merge_array(col.GENRES)},
{_merge_jsonb_objects(col.AUDIO_SET)},
{_merge_jsonb_objects(col.ALT_AUDIO_FILES)}
{_merge_jsonb_objects(col.ALT_FILES)}
'''
)
else:
Expand Down Expand Up @@ -394,7 +394,7 @@ def overwrite_records_in_db_table(
col.CATEGORY,
col.GENRES,
col.AUDIO_SET,
col.ALT_AUDIO_FILES,
col.ALT_FILES,
]
else:
columns_to_update = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE TABLE public.audio (
category character varying(200),
genres character varying(80)[],
audio_set jsonb,
alt_audio_files jsonb,
alt_files jsonb,
filesize integer,
license character varying(50) NOT NULL,
license_version character varying(25),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ CREATE MATERIALIZED VIEW audio_view AS
category,
genres,
audio_set,
alt_audio_files,
alt_files,
filesize,
license,
license_version,
Expand Down
2 changes: 1 addition & 1 deletion src/openledger_sql/03_create_audio_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CREATE TABLE public.audio (
category character varying(200),
genres character varying(80)[],
audio_set jsonb,
alt_audio_files jsonb,
alt_files jsonb,
filesize integer,
license character varying(50) NOT NULL,
license_version character varying(25),
Expand Down

0 comments on commit 27c1ca4

Please sign in to comment.