"""Config for TikTok OpenEscrow Conflict Report Ingestion Workflow. The report is delivered monthly to the orchard FTP share as a single zipped TSV (``TikTok_OpenEscrow_report_.txt.zip``). It is unzipped, archived to the cucumbers bucket as a gzip file and loaded - via a Snowflake stage - into ``CONFLICT_REPORTING.TIKTOK.STAGING_RAW_TIKTOK_OPENESCROW``. """ import os feed_name = 'tiktok_openescrow' secrets_path = 'swf-tiktok-openescrow' # Monthly report file name. ``format`` is 'zip' on the drop side and 'gz' once # archived for loading into Snowflake. filename = 'TikTok_OpenEscrow_report_{date:%Y%m}.txt.{format}' environment = os.environ.get('Environment', 'dev') # Bucket where the partner drops the raw file (orchard FTP share). drop_bucket = os.environ.get('FEED_INGESTION_DROP_BUCKET', 'dev-feed-drop') if environment in ['prod', 'qa']: drop_bucket = 'prod-orcd-ftp' # Bucket for archived data. data_bucket = os.environ.get('FEED_INGESTION_DATA_BUCKET', 'dev-cucumbers') # S3 locations for the dropped and archived files. s3 = { 'drop': 'ftp/Royalty Reports/Musically/TikTok', 'archive': '{feed_name}/archives/{date:%Y-%m}', } # Permanent staging_raw table (already created out-of-band). staging_raw_table = 'STAGING_RAW_TIKTOK_OPENESCROW'