From 954474cadcb9d2bb38194c9c9d2d085f91c570aa Mon Sep 17 00:00:00 2001 From: Mitchell Laferla Date: Fri, 7 Jul 2023 12:28:22 -0700 Subject: [PATCH] removed time from individual scripts --- .../weekly_autolinker_100_links_audit.py | 13 ------------ .../weekly_insights_brand_monitoring.py | 17 ++-------------- monitoring_weekly/weekly_new_brand_combos.py | 13 ------------ .../weekly_new_store_monitoring.py | 12 ----------- monitoring_weekly/weekly_sama_reporting.py | 20 ++++--------------- 5 files changed, 6 insertions(+), 69 deletions(-) diff --git a/monitoring_weekly/weekly_autolinker_100_links_audit.py b/monitoring_weekly/weekly_autolinker_100_links_audit.py index 0225714..31b7bb0 100644 --- a/monitoring_weekly/weekly_autolinker_100_links_audit.py +++ b/monitoring_weekly/weekly_autolinker_100_links_audit.py @@ -10,19 +10,6 @@ import pandas as pd -## Timer function, adjust in function.json ## -def main(mytimer: func.TimerRequest) -> None: - utc_timestamp = datetime.datetime.utcnow().replace( - tzinfo=datetime.timezone.utc).isoformat() - - if mytimer.past_due: - logging.info('The timer is past due!') - - logging.info('Python timer trigger function ran at %s', utc_timestamp) - - logging.info("Weekly Monday Autolinker 100 Links Audit") - - sp = SparkPost(os.environ["SPARKPOST_KEY"]) dir_path = os.getcwd() diff --git a/monitoring_weekly/weekly_insights_brand_monitoring.py b/monitoring_weekly/weekly_insights_brand_monitoring.py index 72ad842..26565d2 100644 --- a/monitoring_weekly/weekly_insights_brand_monitoring.py +++ b/monitoring_weekly/weekly_insights_brand_monitoring.py @@ -4,27 +4,14 @@ import azure.functions as func import time -import sqlalchemy.dialects.sqlite -import pandas as pd from sparkpost import SparkPost from sqlalchemy import create_engine from sqlalchemy.dialects.postgresql import insert +import sqlalchemy.dialects.sqlite +import pandas as pd -## Timer function, adjust in function.json ## -def main(mytimer: func.TimerRequest) -> None: - utc_timestamp = datetime.datetime.utcnow().replace( - tzinfo=datetime.timezone.utc).isoformat() - - if mytimer.past_due: - logging.info('The timer is past due!') - - logging.info('Python timer trigger function ran at %s', utc_timestamp) - - logging.info("Weekly Monday Insights Brand Monitoring") - - sp = SparkPost(os.environ["SPARKPOST_KEY"]) dir_path = os.getcwd() diff --git a/monitoring_weekly/weekly_new_brand_combos.py b/monitoring_weekly/weekly_new_brand_combos.py index cd86a0e..0004cba 100644 --- a/monitoring_weekly/weekly_new_brand_combos.py +++ b/monitoring_weekly/weekly_new_brand_combos.py @@ -12,19 +12,6 @@ -def main(mytimer: func.TimerRequest) -> None: - utc_timestamp = datetime.datetime.utcnow().replace( - tzinfo=datetime.timezone.utc).isoformat() - - if mytimer.past_due: - logging.info('The timer is past due!') - - logging.info('Python timer trigger function ran at %s', utc_timestamp) - - - - logging.info("Weekly Wednesday New Brand Combos") - sp = SparkPost(os.environ["SPARKPOST_KEY"]) dir_path = os.getcwd() diff --git a/monitoring_weekly/weekly_new_store_monitoring.py b/monitoring_weekly/weekly_new_store_monitoring.py index 7ab414c..f974002 100644 --- a/monitoring_weekly/weekly_new_store_monitoring.py +++ b/monitoring_weekly/weekly_new_store_monitoring.py @@ -12,18 +12,6 @@ -def main(mytimer: func.TimerRequest) -> None: - utc_timestamp = datetime.datetime.utcnow().replace( - tzinfo=datetime.timezone.utc).isoformat() - - if mytimer.past_due: - logging.info('The timer is past due!') - - logging.info('Python timer trigger function ran at %s', utc_timestamp) - - - logging.info("Weekly Monday New Store Monitoring") - sp = SparkPost(os.environ["SPARKPOST_KEY"]) dir_path = os.getcwd() diff --git a/monitoring_weekly/weekly_sama_reporting.py b/monitoring_weekly/weekly_sama_reporting.py index 54b9b68..4d59960 100644 --- a/monitoring_weekly/weekly_sama_reporting.py +++ b/monitoring_weekly/weekly_sama_reporting.py @@ -1,25 +1,13 @@ import datetime import logging +import os -import azure.functions as func - - -def main(mytimer: func.TimerRequest) -> None: - utc_timestamp = datetime.datetime.utcnow().replace( - tzinfo=datetime.timezone.utc).isoformat() - - if mytimer.past_due: - logging.info('The timer is past due!') - - logging.info('Python timer trigger function ran at %s', utc_timestamp) - -import pandas as pd -from tabulate import tabulate from sqlalchemy import create_engine -import os from sparkpost import SparkPost from sparkpost.exceptions import SparkPostAPIException - +from tabulate import tabulate +import pandas as pd +import azure.functions as func # Create connection to snowflake db