From 45f2d02a2eb8754be173b9db2369e35adec54b3b Mon Sep 17 00:00:00 2001 From: Jan Rous Date: Wed, 1 Nov 2023 10:52:42 -0600 Subject: [PATCH 1/2] Fix calculating the report_date in demand_hourly_pa_ferc714 --- src/pudl/transform/ferc714.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pudl/transform/ferc714.py b/src/pudl/transform/ferc714.py index 189091ab39..ad07d40e56 100644 --- a/src/pudl/transform/ferc714.py +++ b/src/pudl/transform/ferc714.py @@ -505,9 +505,7 @@ def demand_hourly_pa_ferc714( df.loc[mask, "demand_mwh"] *= -1 # Convert report_date to first day of year - df["report_date"] = pd.Series( - df.loc[:, "report_date"].to_numpy().astype("datetime64[Y]") - ) + df["report_date"] = df.report_date.dt.to_period("Y").dt.to_timestamp() # Format result columns = [ From bf77d1aafb8f50bc9ae43dd3420062fa8500404b Mon Sep 17 00:00:00 2001 From: Zane Selvans Date: Wed, 1 Nov 2023 11:45:27 -0600 Subject: [PATCH 2/2] Require non-null report_date in FERC 714 hourly demand table. --- src/pudl/metadata/fields.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pudl/metadata/fields.py b/src/pudl/metadata/fields.py index 6f7c8f047d..0800a077fb 100644 --- a/src/pudl/metadata/fields.py +++ b/src/pudl/metadata/fields.py @@ -3005,7 +3005,12 @@ "Pacific/Honolulu", ] } - } + }, + "report_date": { + "constraints": { + "required": True, + } + }, }, }