From f6895afb7a67f7908f67aba82782cf17375285cc Mon Sep 17 00:00:00 2001 From: odette-elementl Date: Tue, 1 Aug 2023 16:25:40 -0400 Subject: [PATCH] Adding START_DATE and END_DATE to constants.py --- dagster_university/assets/constants.py | 7 ++++++- dagster_university/partitions/__init__.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/dagster_university/assets/constants.py b/dagster_university/assets/constants.py index e6d0364..ab4d164 100644 --- a/dagster_university/assets/constants.py +++ b/dagster_university/assets/constants.py @@ -1,3 +1,5 @@ +from datetime import date + TAXI_ZONES_FILE_PATH = "data/raw/taxi_zones.csv" TAXI_TRIPS_TEMPLATE_FILE_PATH = "data/raw/taxi_trips_{}.parquet" @@ -8,4 +10,7 @@ REQUEST_DESTINATION_TEMPLATE_FILE_PATH = "data/outputs/{}.png" -DATE_FORMAT = "%Y-%m-%d" \ No newline at end of file +DATE_FORMAT = "%Y-%m-%d" + +START_DATE = "2023-01-01" +END_DATE = "2023-04-01" \ No newline at end of file diff --git a/dagster_university/partitions/__init__.py b/dagster_university/partitions/__init__.py index e713dbe..ccf34a3 100644 --- a/dagster_university/partitions/__init__.py +++ b/dagster_university/partitions/__init__.py @@ -1,9 +1,11 @@ from dagster import MonthlyPartitionsDefinition, WeeklyPartitionsDefinition from os import environ +from ..assets import constants + ## Lesson 8 -start_date = environ.get("START_DATE", "2023-01-01") -end_date = environ.get("END_DATE", "2023-04-01") +start_date = constants.START_DATE +end_date = constants.END_DATE monthly_partition = MonthlyPartitionsDefinition( start_date=start_date,