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>
This commit is contained in:
Emmanuel Ferdman 2025-05-22 20:53:42 +03:00 committed by GitHub
parent 8be7108829
commit e42884a566
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@
### Fixes
- **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.
- **Fix logger deprecation warning**: Replaced usage of `logger.warn` with `logger.warning` to comply with the Python logging standards.
- **Throw validation error when json is passed with invalid unstructured json
## 0.17.6

View File

@ -86,7 +86,7 @@ def partition_via_api(
if file_filename is not None:
metadata_filename = file_filename
logger.warn(
logger.warning(
"The file_filename kwarg will be deprecated in a future version of unstructured. "
"Please use metadata_filename instead.",
)
@ -277,7 +277,7 @@ def partition_multiple_via_api(
if file_filenames is not None:
metadata_filenames = file_filenames
logger.warn(
logger.warning(
"The file_filenames kwarg will be deprecated in a future version of unstructured. "
"Please use metadata_filenames instead.",
)