Closed
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses various warnings across the codebase and fixes minor test issues. The changes include deprecation warnings, API usage warnings, Pydantic v2 migration fixes, and enhanced logging.
- Fixed PyTorch softmax API warning by adding missing dim parameter
- Updated Pydantic v2 compatibility by replacing deprecated
__fields_set__withmodel_fields_set - Converted asset integrity check failures from errors to warnings to handle Windows CRLF line ending differences
- Added warning filters for external library deprecation warnings
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/shared_test_utils/src/shared_test_utils/collector.py | Fixed escaped parentheses in docstring |
| packages/shared_test_utils/src/shared_test_utils/assets.py | Converted RuntimeError to warnings for asset size/hash mismatches to handle Windows CRLF issues |
| packages/pyproject.toml | Added pytest filter to ignore defusedxml deprecation warning |
| packages/deepdoctection/src/deepdoctection/pipe/order.py | Fixed logic bug by adding missing negation to subset check |
| packages/deepdoctection/src/deepdoctection/extern/hflm.py | Added missing dim parameter to F.softmax call to fix PyTorch warning |
| packages/deepdoctection/src/deepdoctection/extern/hfdetr.py | Suppressed "copying from a non-meta parameter" warning when loading models |
| packages/dd_core/src/dd_core/utils/env_info.py | Updated to Pydantic v2 API using model_fields_set instead of fields_set |
| packages/dd_core/src/dd_core/mapper/maputils.py | Enhanced error logging with more detailed error type and message information |
| packages/dd_core/src/dd_core/datapoint/annotation.py | Added protected_namespaces config to suppress Pydantic warning |
Comments suppressed due to low confidence (2)
packages/shared_test_utils/src/shared_test_utils/assets.py:208
- Converting integrity check failures from RuntimeError to warnings may hide legitimate asset corruption issues. While CRLF line ending differences on Windows are valid edge cases, genuine corruption (wrong file downloaded, partial transfer, etc.) will now silently pass. Consider only downgrading to a warning for small discrepancies that are likely CRLF-related, while still raising errors for significant mismatches.
warnings.warn(
f"Asset '{key}' size mismatch (likely due to CRLF):\n"
f" Expected: {expected_size} bytes\n"
f" Actual: {actual_size} bytes\n"
f" Path: {abs_path}"
)
packages/shared_test_utils/src/shared_test_utils/assets.py:222
- Converting SHA-256 hash mismatch from RuntimeError to warning is risky. Hash mismatches typically indicate serious issues (file corruption, tampering, incomplete download). While CRLF differences can cause hash mismatches, silently continuing with a potentially corrupted file could lead to unpredictable test failures or incorrect behavior. Consider only downgrading to a warning when the size difference matches expected CRLF conversion (e.g., difference equals line count), while still raising errors for genuine corruption.
warnings.warn(
f"Asset '{key}' SHA-256 mismatch:\n"
f" Expected: {expected_hash}\n"
f" Actual: {actual_hash}\n"
f" Path: {abs_path}\n"
f"The file may have been modified or corrupted."
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
JaMe76
added a commit
that referenced
this pull request
Feb 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There were some warnings and minor test warning and errors, fixed them.
Also added a bit more info when logging.