"""Constants related to pandas.""" import pandas as pd from constants import spreadsheet as sheet_consts LEADING_ZERO_CONVERTORS = { sheet_consts.digital_upc: str, sheet_consts.manufacturers_upc: str, } CONVERTORS = { sheet_consts.release_name: str, sheet_consts.release_meta_language: str, sheet_consts.orchard_artist: str, sheet_consts.artist_country: str, sheet_consts.subaccount_name: str, sheet_consts.artist_url: str, sheet_consts.release_artists_primary_artist: str, sheet_consts.release_artists_featurings: str, sheet_consts.release_artists_remixers: str, sheet_consts.release_artists_producers: str, sheet_consts.release_artists_composers: str, sheet_consts.release_artists_orchestras: str, sheet_consts.release_artists_ensembles: str, sheet_consts.release_artists_conductors: str, sheet_consts.itunes_preorder: str, sheet_consts.preorder_preview: str, sheet_consts.album_pricing: str, sheet_consts.format_full_length_ep_single: str, sheet_consts.imprint: str, sheet_consts.genre: str, sheet_consts.sub_genre: str, sheet_consts.c_information: str, sheet_consts.folder_name_project_code: str, sheet_consts.product_code: str, sheet_consts.release_version: str, sheet_consts.file_name: str, sheet_consts.volume: int, sheet_consts.track_no: int, sheet_consts.track_name: str, sheet_consts.track_audio_language: str, sheet_consts.version: str, sheet_consts.track_artist: str, sheet_consts.track_artists_featurings: str, sheet_consts.track_artists_remixers: str, sheet_consts.track_artists_producers: str, sheet_consts.track_artists_composers: str, sheet_consts.track_artists_orchestras: str, sheet_consts.track_artists_ensembles: str, sheet_consts.track_artists_conductors: str, sheet_consts.track_pricing: str, sheet_consts.explicit: str, sheet_consts.isrc: str, sheet_consts.third_party_publisher: str, sheet_consts.p_information: str, sheet_consts.ownership_for_this_sound_recording: str, sheet_consts.country_of_recording: str, sheet_consts.nationality_of_original_copyright_owner: str, sheet_consts.track_lyrics: str, sheet_consts.songwriters: str, sheet_consts.publishers: str, sheet_consts.performer_1_type: str, sheet_consts.performer_1_legal_name: str, sheet_consts.performer_1_main_role: str, sheet_consts.performer_2_type: str, sheet_consts.performer_2_legal_name: str, sheet_consts.performer_2_main_role: str, sheet_consts.performer_3_type: str, sheet_consts.performer_3_legal_name: str, sheet_consts.performer_3_main_role: str, sheet_consts.performer_4_type: str, sheet_consts.performer_4_legal_name: str, sheet_consts.performer_4_main_role: str, sheet_consts.performer_5_type: str, sheet_consts.performer_5_legal_name: str, sheet_consts.performer_5_main_role: str, sheet_consts.only_include_only_exclude: str, sheet_consts.territories_iso_codes: str, sheet_consts.catalog_ingest: str, sheet_consts.orchlabelid: int, # Coerce fields to YYYY-MM-DD format sheet_consts.itunes_preorder_date: lambda x: pd.to_datetime( x, errors='coerce', format='%Y-%m-%d'), sheet_consts.release_date: lambda x: pd.to_datetime( x, errors='coerce', format='%Y-%m-%d'), sheet_consts.sale_start_date: lambda x: pd.to_datetime( x, errors='coerce', format='%Y-%m-%d') }