Skip to content

Commit

Permalink
fix call to preserve type fn
Browse files Browse the repository at this point in the history
  • Loading branch information
crvernon committed Apr 10, 2024
1 parent 63d0894 commit 569eb51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion statemodify/xdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ def convert(self):
months=self.months,
output_path=self.output_path,
id_subset=self.id_subset,
preserve_string_dtype=self.preserve_string_dtype,
)
for file in tqdm(self.xdd_files)
)
Expand All @@ -269,6 +270,7 @@ def _parse_file(
months: list[str],
output_path: str,
id_subset: Union[None, list[str]],
preserve_string_dtype: bool,
):
data = []
with open(file) as f:
Expand All @@ -290,7 +292,7 @@ def _parse_file(
if id_subset is not None:
df = df[df["structure_id"].isin(id_subset)]

if self.preserve_string_dtype is False:
if preserve_string_dtype is False:
df = df.astype(self.field_dtypes)

df.to_parquet(f"{output_path}/{Path(file).stem}.parquet")
Expand Down

0 comments on commit 569eb51

Please sign in to comment.