Skip to content

Conversation

jamesbraza
Copy link
Collaborator

@jamesbraza jamesbraza commented Mar 29, 2025

Seen in pytest logs after #920:

tests/test_clients.py: 422 warnings
tests/test_agents.py: 281 warnings
  /path/to/paper-qa/paperqa/clients/semantic_scholar.py:207: PydanticDeprecatedSince211: Accessing this attribute on the instance is deprecated, and will be removed in Pydantic V3. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
    if key not in doc_details.model_fields:

tests/test_clients.py: 691 warnings
tests/test_agents.py: 367 warnings
tests/test_paperqa.py: 7 warnings
  /path/to/paper-qa/paperqa/clients/crossref.py:230: PydanticDeprecatedSince211: Accessing this attribute on the instance is deprecated, and will be removed in Pydantic V3. Instead, you should access this attribute from the model class. Deprecated in Pydantic V2.11 to be removed in V3.0.
    if key not in doc_details.model_fields:

Also this one from litellm:

.venv/lib/python3.12/site-packages/litellm/caching/llm_caching_handler.py:18: 12 warnings
  /Users/jamesbraza/code/paper-qa/.venv/lib/python3.12/site-packages/litellm/caching/llm_caching_handler.py:18: DeprecationWarning: There is no current event loop
    event_loop = asyncio.get_event_loop()

This PR also documents a py.typed issue for openreview-py

@jamesbraza jamesbraza added the bug Something isn't working label Mar 29, 2025
@jamesbraza jamesbraza self-assigned this Mar 29, 2025
@Copilot Copilot AI review requested due to automatic review settings March 29, 2025 23:57
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 29, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses Pydantic deprecation warnings by updating attribute access for model_fields in client modules and documents a known issue with openreview-py in the pyproject.toml file.

  • Change 1: Accessing model_fields via type(doc_details) instead of via the instance in both semantic_scholar.py and crossref.py.
  • Change 2: Adding an inline comment in pyproject.toml to document an openreview-py issue.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pyproject.toml Added a comment for openreview-py to document a related issue
paperqa/clients/semantic_scholar.py Updated attribute access to model_fields via type(doc_details)
paperqa/clients/crossref.py Updated attribute access to model_fields via type(doc_details)

@jamesbraza jamesbraza changed the title Resolved a few PydanticDeprecatedSince211 warnings Resolved a few deprecation warnings Mar 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 30, 2025
@jamesbraza jamesbraza merged commit 278b891 into main Mar 30, 2025
4 of 5 checks passed
@jamesbraza jamesbraza deleted the less-noisy-ci branch March 30, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants