def get_sql(period_ids, account_type, account_id, collaborator_id, exclude_transaction_types): print(f'CALL get_sql({period_ids}, {account_type}, {account_id}, {collaborator_id}, {exclude_transaction_types})') return """ SELECT * FROM all_the_money JOIN labels ON type = {account_type} AND id = {account_id} WHERE collaborator = {collaborator_id} AND period IN ({period_ids}) """.format( period_ids=period_ids, account_type=account_type, account_id=account_id, collaborator_id=collaborator_id ) def unload_to_s3(s3_url, unload_query): print(f'CALL unload_to_s3({s3_url}, {unload_query})')