Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
nonprofittechy committed Apr 25, 2024
1 parent 7277c42 commit 0c0f81f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docassemble/AssemblyLine/al_courts.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,17 @@ def _load_courts(self) -> pd.DataFrame:
def convert_zip(z: Any) -> str:
return str(z).zfill(5)

merged_converters: Dict[str, Callable[[object], object]] = {"address_zip": convert_zip}
merged_converters: Dict[str, Callable[[object], object]] = {
"address_zip": convert_zip
}
if hasattr(self, "converters") and self.converters:
assert(isinstance(self.converters, dict))
assert isinstance(self.converters, dict)
merged_converters.update(self.converters)
to_load = path_and_mimetype(load_path)[0]
if self.filename.lower().endswith(".xlsx"):
df = pd.read_excel(to_load, converters=merged_converters) # type: ignore
df = pd.read_excel(to_load, converters=merged_converters) # type: ignore
elif self.filename.lower().endswith(".csv"):
df = pd.read_csv(to_load, converters=merged_converters) # type: ignore
df = pd.read_csv(to_load, converters=merged_converters) # type: ignore
elif self.filename.lower().endswith(".json"):
# TODO: we may need to normalize a JSON file
df = pd.read_json(to_load)
Expand Down

0 comments on commit 0c0f81f

Please sign in to comment.