Skip to content

Commit

Permalink
refactor: For S3 Ingest, write to file directly using json.dump (#312)
Browse files Browse the repository at this point in the history
* Write to file directly using json.dump

No changelog entry due to the simplicity of the change
  • Loading branch information
tomaarsen committed Mar 1, 2023
1 parent a6f8256 commit 95109db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 0.5.2-dev1

### Enhancements

### Features

### Fixes

## 0.5.1

### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion unstructured/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.1" # pragma: no cover
__version__ = "0.5.2-dev1" # pragma: no cover
2 changes: 1 addition & 1 deletion unstructured/ingest/connector/s3_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def write_result(self):
output_filename = self._output_filename()
output_filename.parent.mkdir(parents=True, exist_ok=True)
with open(output_filename, "w") as output_f:
output_f.write(json.dumps(self.isd_elems_no_filename, ensure_ascii=False, indent=2))
json.dump(self.isd_elems_no_filename, output_f, ensure_ascii=False, indent=2)
print(f"Wrote {output_filename}")

@property
Expand Down

0 comments on commit 95109db

Please sign in to comment.