Refactor join conditions in dash_app

fix is weekday issue, making fridays a weekend
update ERD
This commit is contained in:
Jake Pullen
2024-08-29 11:02:15 +01:00
parent bd0ebd38e9
commit 91d67896d1
5 changed files with 30 additions and 13 deletions
+1 -1
View File
@@ -200,7 +200,7 @@ class DimDate(Dimensions):
try:
# Create a new column to indicate if the date is a weekday or weekend
dates_df = dates_df.with_columns([
(pl.col('weekday') < 5).alias('is_weekday') # True for weekdays (Monday to Friday), False for weekends (Saturday and Sunday)
(pl.col('weekday') < 6).alias('is_weekday') # True for weekdays (Monday to Friday), False for weekends (Saturday and Sunday)
])
except Exception as e:
logging.error(f"Failed to create a new column to indicate if the date is a weekday or weekend: {e}")