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

AttributeError: type object 'VaultOverview' has no attribute 'model_validate' #109

Open
alavi-sorrek opened this issue Sep 10, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@alavi-sorrek
Copy link

Scenario & Reproduction Steps

Seems any time I try to list vaults or list items using the docs' suggestions, I'm thrown an attribute error related to model_validate for both items and vaults.

pip install git+https://github.com/1Password/[email protected]#egg=onepassword

import asyncio
from onepassword.client import Client

async def get_items():
    client = await Client.authenticate(auth=token, integration_name="secret_loader", integration_version="v1.0.0")
    vaults = await client.vaults.list_all()
    async for vault in vaults:
        print(vault.title)
        items = await client.items.list_all(vault.id)
        async for item in items:
            print(item.title)


asyncio.run(get_items())

Actual Behavior

AttributeError: type object 'VaultOverview' has no attribute 'model_validate'

Expected Behavior

I'm expecting to retrieve information related to vaults and items in them that are associated with my account

SDK version

No response

Additional information

No response

@alavi-sorrek alavi-sorrek added the bug Something isn't working label Sep 10, 2024
@hculea
Copy link
Member

hculea commented Sep 12, 2024

Hi @alavi-sorrek , thank you for reaching out. Can you please give me a few more details related to:

  • the platform where you are running the SDK (OS + arch)
  • the Python version that you use
  • if you are running in any virtual environment, or if you use a pyproject.toml manifest to declare your project's dependencies

Looking forward to hearing back from you!

@alavi-sorrek
Copy link
Author

alavi-sorrek commented Sep 12, 2024 via email

@MOmarMiraj
Copy link
Contributor

Hi @alavi-sorrek,

We pushed a fix for a bad commit when installing the Python SDK. Could you please retry and let me know if the error is still happening. If so, I have some follow up questions:

  1. Did you try running the example.py code and does that work fine?
  2. What version of pydantic are you using?

Looking forward to hearing from you!

@alavi-sorrek
Copy link
Author

alavi-sorrek commented Sep 24, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants