Created
June 27, 2021 14:53
-
-
Save anna-geller/7e93d40a8e3e3c3093c4686a8d1ed6ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import logging | |
import awswrangler as wr | |
from timeseries_data_test_runner import TimeseriesDataTestRunner | |
logger = logging.getLogger() | |
logger.setLevel(logging.INFO) | |
def handler(event, context): | |
logger.info("Received event: " + json.dumps(event)) | |
bucket = event["Records"][0]["s3"]["bucket"]["name"] | |
key = event["Records"][0]["s3"]["object"]["key"] | |
s3_path = f"s3://{bucket}/{key}" | |
df = wr.s3.read_parquet(s3_path) | |
TimeseriesDataTestRunner(s3_path=s3_path).run_data_tests(df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment