You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if I pass a list of pathlib.Path objects into ImportArguments(input_file_list=), the processing runs well until "Finishing" step. At this step metadata creation fails when trying to dump json, saying that PosixPath is not serialiasable. Since stdlib's pathlib.Path is a modern and convenient way of path manipulations, I believe we should support it.
File ~/.virtualenvs/hipscat-import-sfd/lib/python3.11/site-packages/hipscat/io/write_metadata.py:27, in write_json_file(metadata_dictionary, file_pointer, storage_options)
15 def write_json_file(
16 metadata_dictionary: dict,
17 file_pointer: file_io.FilePointer,
18 storage_options: Union[Dict[Any, Any], None] = None,
19 ):
20 """Convert metadata_dictionary to a json string and print to file.
21
22 Args:
(...)
25 storage_options: dictionary that contains abstract filesystem credentials
26 """
---> 27 dumped_metadata = json.dumps(metadata_dictionary, indent=4)
28 file_io.write_string_to_file(file_pointer, dumped_metadata + "\n", storage_options=storage_options)
TypeError: Object of type PosixPath is not JSON serializable
The text was updated successfully, but these errors were encountered:
Currently, if I pass a list of
pathlib.Path
objects intoImportArguments(input_file_list=)
, the processing runs well until "Finishing" step. At this step metadata creation fails when trying to dump json, saying thatPosixPath
is not serialiasable. Since stdlib'spathlib.Path
is a modern and convenient way of path manipulations, I believe we should support it.The text was updated successfully, but these errors were encountered: