Skip to content

Commit

Permalink
Fix encoding issue of job metadata in on_job_done #657
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Nov 8, 2024
1 parent 623bcfe commit 9eabc7a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- `MultiBackendJobManager`: Fix issue with duplicate job starting across multiple backends ([#654](https://github.com/Open-EO/openeo-python-client/pull/654))
- `MultiBackendJobManager`: Fix encoding issue of job metadata in `on_job_done` ([#657](https://github.com/Open-EO/openeo-python-client/issues/657))


## [0.34.0] - 2024-10-31
Expand Down
2 changes: 1 addition & 1 deletion openeo/extra/job_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ def on_job_done(self, job: BatchJob, row):
self.ensure_job_dir_exists(job.job_id)
job.get_results().download_files(target=job_dir)

with open(metadata_path, "w") as f:
with metadata_path.open("w", encoding="utf-8") as f:
json.dump(job_metadata, f, ensure_ascii=False)

def on_job_error(self, job: BatchJob, row):
Expand Down
2 changes: 1 addition & 1 deletion openeo/udf/xarraydatacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def to_json_file(cls, array: xarray.DataArray, path: Union[str, Path]):
jsonarray['coords'][i.name]['attrs']['shape'] = list(i.shape)
# custom print so resulting json file is humanly easy to read
# TODO: make this human friendly JSON format optional and allow compact JSON too.
with Path(path).open("w") as f:
with Path(path).open("w", encoding="utf-8") as f:
def custom_print(data_structure, indent=1):
f.write("{\n")
needs_comma = False
Expand Down

0 comments on commit 9eabc7a

Please sign in to comment.