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

validate_call causes problems with inspect.getmembers #8610

Closed
1 task done
mroethke opened this issue Jan 23, 2024 · 4 comments
Closed
1 task done

validate_call causes problems with inspect.getmembers #8610

mroethke opened this issue Jan 23, 2024 · 4 comments
Labels
bug V2 Bug related to Pydantic V2 pending Awaiting a response / confirmation

Comments

@mroethke
Copy link

Initial Checks

  • I confirm that I'm using Pydantic V2

Description

When using the validate_call decorator in a base class, calling inspect.getmembers on a derived class raises a TypeError. I would expect this to not raise an Exception.

Example Code

import inspect
import pydantic

class Test:
    @pydantic.validate_call
    def foobar():
        pass

class Test2(Test):
    pass

inspect.getmembers(Test2)

Python, Pydantic & OS Version

pydantic version: 2.5.3
        pydantic-core version: 2.14.6
          pydantic-core build: profile=release pgo=false
                 install path: /usr/lib/python3.11/site-packages/pydantic
               python version: 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801]
                     platform: Linux-6.7.0-arch3-1-x86_64-with-glibc2.38
             related packages: typing_extensions-4.9.0
@mroethke mroethke added bug V2 Bug related to Pydantic V2 pending Awaiting a response / confirmation labels Jan 23, 2024
@alexmojaki
Copy link
Contributor

Try with pydantic version 2.6.0b1. I'm not seeing an error when I run this locally and I think that's because I'm working with more recent code which in particular includes #8268.

@mroethke
Copy link
Author

It does indeed work with 2.6.0b1, any idea when this will land in stable?

@alexmojaki
Copy link
Contributor

Thanks for testing the beta!

I believe @sydney-runkle is planning on releasing the final 2.6.0 tomorrow

@mroethke
Copy link
Author

awesome, and thank you for your quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V2 Bug related to Pydantic V2 pending Awaiting a response / confirmation
Projects
None yet
Development

No branches or pull requests

2 participants