Skip to content

[Bug] DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. #330

Closed

Description

@foobarfighter

Is this a new bug in the Pinecone Python client?

  • I believe this is a new bug in the Pinecone Python Client
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

This warning is generated when running unit tests that include PineconeGRPC on python 3.12.

../../Library/Caches/pypoetry/virtualenvs/ragie-EJQDw0bC-py3.12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:91
  /Users/bob/Library/Caches/pypoetry/virtualenvs/ragie-EJQDw0bC-py3.12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:91: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    _EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0)

Expected Behavior

No warning is generated.

Steps To Reproduce

Minimal test case:

from pinecone.grpc import PineconeGRPC


def test_foo():
    pass

Relevant log output

============================================================================================================= test session starts ==============================================================================================================
platform darwin -- Python 3.12.2, pytest-8.1.1, pluggy-1.4.0
rootdir: /Users/bob/workspace/ragie
configfile: pyproject.toml
plugins: anyio-4.3.0, asyncio-0.23.6
asyncio: mode=Mode.STRICT
collected 1 item

tests/test_foo.py .                                                                                                                                                                                                                      [100%]

=============================================================================================================== warnings summary ===============================================================================================================
../../Library/Caches/pypoetry/virtualenvs/ragie-EJQDw0bC-py3.12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:91
  /Users/bob/Library/Caches/pypoetry/virtualenvs/ragie-EJQDw0bC-py3.12/lib/python3.12/site-packages/google/protobuf/internal/well_known_types.py:91: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    _EPOCH_DATETIME_NAIVE = datetime.datetime.utcfromtimestamp(0)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================================= 1 passed, 1 warning in 0.06s =========================================================================================================

Environment

- OS: macOS 14.3 (23D56)
- Python: 3.12
- pinecone: 3.2.2

Additional Context

No response

Activity

  1. added
    bug
    on Apr 12, 2024
  2. daverigby commented on May 1, 2024

    @daverigby
    Contributor

    The warning from protobuf

    google/protobuf/internal/well_known_types.py:91: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    

    Should be resolved as of pinecone-client v4.0.0 as that upgrades to a version of protobuf (v4.25) which has fixed the deprecation issue.

  3. foobarfighter commented on May 3, 2024

    @foobarfighter
    Author

    Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions