diff --git a/statemodify/xdd.py b/statemodify/xdd.py index 8c44419..74d5592 100644 --- a/statemodify/xdd.py +++ b/statemodify/xdd.py @@ -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) ) @@ -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: @@ -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")