Skip to content

Commit

Permalink
bugfix/add if statement for support when creating model (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbiseck3 authored Oct 29, 2024
1 parent f89d2a6 commit 19e8cfa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.10

* **Bugfix: Add `None` support in mapping `FileDataMeta` response**

## 0.0.9

* **Support optionally exposing addition metadata around FileData**
Expand Down
2 changes: 1 addition & 1 deletion unstructured_platform_plugins/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.9" # pragma: no cover
__version__ = "0.0.10" # pragma: no cover
3 changes: 3 additions & 0 deletions unstructured_platform_plugins/etl_uvicorn/api_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def update_filedata_model(new_type) -> BaseModel:
field_info = NewRecord.model_fields["contents"]
if is_optional(new_type):
field_info.default = None
if new_type is None:
new_type = type(None)
field_info.default = None
new_record_model = create_model(
NewRecord.__name__, contents=(new_type, field_info), __base__=NewRecord
)
Expand Down

0 comments on commit 19e8cfa

Please sign in to comment.