From 19fb8f564f4203ca8fd25b4b2d291b8de32cabba Mon Sep 17 00:00:00 2001 From: folajimiogunbadejo Date: Mon, 21 Jun 2021 02:29:15 +0100 Subject: [PATCH] fix error --- etl.ipynb | 2 +- etl.py | 2 +- sql_queries.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/etl.ipynb b/etl.ipynb index ebbe23e..c4aa303 100644 --- a/etl.ipynb +++ b/etl.ipynb @@ -312,7 +312,7 @@ "metadata": {}, "outputs": [], "source": [ - "time_data = list(zip(t.dt.time, t.dt.hour, t.dt.day, t.dt.isocalendar().week, t.dt.month, t.dt.year, t.dt.weekday))\n", + "time_data = list(zip(t.dt.values, t.dt.hour, t.dt.day, t.dt.week, t.dt.month, t.dt.year, t.dt.weekday))\n", "column_labels = ('start_time', 'hour', 'day', 'week', 'month', 'year', 'weekday')" ] }, diff --git a/etl.py b/etl.py index b1ac414..26cf11b 100644 --- a/etl.py +++ b/etl.py @@ -51,7 +51,7 @@ def process_log_file(cur, filepath): t = df["ts"] # insert time data records - time_data = list(zip(t.dt.time, t.dt.hour, t.dt.day, t.dt.isocalendar().week, t.dt.month, t.dt.year, t.dt.weekday)) + time_data = list(zip(t.dt.values, t.dt.hour, t.dt.day, t.dt.week, t.dt.month, t.dt.year, t.dt.weekday)) column_labels = ('start_time', 'hour', 'day', 'week', 'month', 'year', 'weekday') time_df = pd.DataFrame(time_data, columns=column_labels) diff --git a/sql_queries.py b/sql_queries.py index 1e2992a..1c8050e 100644 --- a/sql_queries.py +++ b/sql_queries.py @@ -14,8 +14,8 @@ start_time timestamp NOT NULL, user_id varchar NOT NULL, level varchar, - song_id char(18) NOT NULL, - artist_id char(18) NOT NULL, + song_id char(18), + artist_id char(18), session_id int NOT NULL, location varchar, user_agent varchar