Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make Haystack warnings consistent #9083

Merged
merged 3 commits into from
Mar 21, 2025
Merged

chore: make Haystack warnings consistent #9083

merged 3 commits into from
Mar 21, 2025

Conversation

anakin87
Copy link
Member

Related Issues

Across our codebase, we mostly use logging.warning but sometimes we also use warnings.warn.

We have decided to:

  • use logging.warning
  • use warnings.warn (DeprecationWarning) only for deprecations

Proposed Changes:

  • replace warnings.warn with logging.warning (taking also care of structured logging)

How did you test it?

CI; adapted some tests on warnings

Checklist

  • I have read the contributors guidelines and the code of conduct
  • I have updated the related issue with new insights and changes
  • I added unit tests and updated the docstrings
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I documented my code
  • I ran pre-commit hooks and fixed any issue

@anakin87 anakin87 added the ignore-for-release-notes PRs with this flag won't be included in the release notes. label Mar 20, 2025
@anakin87 anakin87 marked this pull request as ready for review March 20, 2025 16:05
@anakin87 anakin87 requested a review from a team as a code owner March 20, 2025 16:05
@anakin87 anakin87 requested review from mpangrazzi and removed request for a team March 20, 2025 16:05
@anakin87 anakin87 marked this pull request as draft March 20, 2025 16:06
@coveralls
Copy link
Collaborator

coveralls commented Mar 20, 2025

Pull Request Test Coverage Report for Build 13974248160

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 37 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.005%) to 90.012%

Files with Coverage Reduction New Missed Lines %
components/converters/output_adapter.py 1 98.48%
components/embedders/hugging_face_api_text_embedder.py 1 97.1%
components/embedders/hugging_face_api_document_embedder.py 2 96.59%
components/evaluators/llm_evaluator.py 2 94.96%
components/readers/extractive.py 3 95.69%
components/routers/conditional_router.py 12 85.94%
evaluation/eval_run_result.py 16 62.37%
Totals Coverage Status
Change from base Build 13971804559: -0.005%
Covered Lines: 9814
Relevant Lines: 10903

💛 - Coveralls

@anakin87 anakin87 marked this pull request as ready for review March 20, 2025 16:20
Copy link
Contributor

@mpangrazzi mpangrazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Will probably do the same in Hayhooks.

@anakin87 anakin87 merged commit 1c1030e into main Mar 21, 2025
27 checks passed
@anakin87 anakin87 deleted the use-logging-warning branch March 21, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ignore-for-release-notes PRs with this flag won't be included in the release notes. topic:tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants