Skip to content

Commit

Permalink
read_metadata: add dtype for METADATA_DATE_COLUMN
Browse files Browse the repository at this point in the history
Avoid Pandas type inference for the date column because it could contain
incomplete year only dates that get inferred as int.
  • Loading branch information
joverlee521 committed May 26, 2023
1 parent bd4b5d8 commit def0840
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion augur/io/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def read_metadata(metadata_file, delimiters=DEFAULT_DELIMITERS, id_columns=DEFAU
# of having its type inferred. This latter argument allows users to provide
# numerical ids that don't get converted to numbers by pandas.
kwargs["index_col"] = index_col
kwargs["dtype"] = {index_col: "string"}
kwargs["dtype"] = {
index_col: "string",
METADATA_DATE_COLUMN: "string"
}

return pd.read_csv(
metadata_file,
Expand Down

0 comments on commit def0840

Please sign in to comment.