Skip to content

Commit

Permalink
fix: correctly swap json<->xml dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
fritz-astronomer committed Aug 29, 2024
1 parent 2db0974 commit 3a955bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions orbiter/file_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def ext_validate(cls, v: Set[str]):
class FileTypeJSON(FileType):
extension: ClassVar[Set[str]] = {"JSON"}
load_fn: ClassVar[Callable[[str], dict]] = json.loads
dump_fn: ClassVar[Callable[[dict], str]] = xmltodict.unparse
dump_fn: ClassVar[Callable[[dict], str]] = partial(
json.dumps, default=str, indent=2
)


# noinspection t
Expand Down Expand Up @@ -106,9 +108,7 @@ def _fix(d):
class FileTypeXML(FileType):
extension: ClassVar[Set[str]] = {"XML"}
load_fn: ClassVar[Callable[[str], dict]] = xmltodict_parse
dump_fn: ClassVar[Callable[[dict], str]] = partial(
json.dumps, default=str, indent=2
)
dump_fn: ClassVar[Callable[[dict], str]] = xmltodict.unparse


class FileTypeYAML(FileType):
Expand Down

0 comments on commit 3a955bd

Please sign in to comment.