Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 50af45a

Browse files
authored
Merge pull request #618 from openclimatefix/jack/metadata-fix
Jack/metadata fix
2 parents 8bcfdb6 + 8b4ef04 commit 50af45a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nowcasting_dataset/data_sources/metadata/metadata_model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def load_from_csv(
161161
nrows=nrows,
162162
names=names,
163163
)
164+
# If the CSV doesn't contain the optional columns, then drop those missing columns.
165+
# (Otherwise Pandas creates a column with NaNs, which confuses Pydantic!)
166+
metadata_df = metadata_df.dropna(axis="columns", how="all")
164167

165168
assert (
166169
len(metadata_df) > 0

0 commit comments

Comments
 (0)