Skip to content

Commit e42884a

Browse files
fix: resolve warnings of logger library (#3999)
# PR Summary This PR resolves the deprecation warnings of the `logger` library: ```python DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead ``` --------- Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> Co-authored-by: cragwolfe <crag@unstructured.io>
1 parent 8be7108 commit e42884a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
### Fixes
88
- **Fix image extraction for PNG files.** When `extract_image_block_to_payload` is True, and the image is a PNG, we get a Pillow error. We need to remove the PNG transparency layer before saving the image.
9+
- **Fix logger deprecation warning**: Replaced usage of `logger.warn` with `logger.warning` to comply with the Python logging standards.
910
- **Throw validation error when json is passed with invalid unstructured json
1011

1112
## 0.17.6

unstructured/partition/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def partition_via_api(
8686

8787
if file_filename is not None:
8888
metadata_filename = file_filename
89-
logger.warn(
89+
logger.warning(
9090
"The file_filename kwarg will be deprecated in a future version of unstructured. "
9191
"Please use metadata_filename instead.",
9292
)
@@ -277,7 +277,7 @@ def partition_multiple_via_api(
277277

278278
if file_filenames is not None:
279279
metadata_filenames = file_filenames
280-
logger.warn(
280+
logger.warning(
281281
"The file_filenames kwarg will be deprecated in a future version of unstructured. "
282282
"Please use metadata_filenames instead.",
283283
)

0 commit comments

Comments
 (0)