From 86d9f198fce974637e7d2d759ccfbf477530523c Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Wed, 14 Jul 2021 11:32:06 +1200 Subject: [PATCH] refactor: Forward optionals where applicable --- pystac/stac_io.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pystac/stac_io.py b/pystac/stac_io.py index 70fd4ce70..a0108566a 100644 --- a/pystac/stac_io.py +++ b/pystac/stac_io.py @@ -98,7 +98,7 @@ def json_loads(self, txt: str, *args: Any, **kwargs: Any) -> Dict[str, Any]: if orjson is not None: result = orjson.loads(txt) else: - result = json.loads(txt) + result = json.loads(txt, *args, **kwargs) return result def json_dumps(self, json_dict: Dict[str, Any], *args: Any, **kwargs: Any) -> str: @@ -115,9 +115,11 @@ def json_dumps(self, json_dict: Dict[str, Any], *args: Any, **kwargs: Any) -> st json_dict : The dictionary to serialize """ if orjson is not None: - return orjson.dumps(json_dict, option=orjson.OPT_INDENT_2).decode("utf-8") + return orjson.dumps(json_dict, option=orjson.OPT_INDENT_2, **kwargs).decode( + "utf-8" + ) else: - return json.dumps(json_dict, indent=2) + return json.dumps(json_dict, *args, indent=2, **kwargs) def stac_object_from_dict( self,