MENU

Fun & Interesting

"Validating Complex Types Using Pydantic" - Daniel Schelkoph (PyOhio 2024)

PyOhio 127 lượt xem 8 months ago
Video Not Working? Fix It Now

Daniel Schelkoph

https://www.pyohio.org/2024/program/talks/validating-complex-types-using-pydantic

For some Python Objects it is difficult to understand its contents, even if type annotations are used. For example, PyTorch's `Tensor` or Pandas's `DataFrame` have many different "shapes" to their data structures, but their type annotations are always the same. This can make it very difficult to understand functions that utilize these objects as parameters or return these objects. When reviewing code, it is very common to ask these sorts of questions:

* What is the shape of the `Tensor` I need to pass in?
* What columns does this `DataFrame` need to have?

In this talk, we will describe how to utilize typing metadata and Pydantic to not only provide additional context for these data structures, but to validate the input/output of functions as well.

#PyOhio #Python

The 17th annual PyOhio held July 27-28 in Cleveland, OH.

===
https://PyOhio.org

Founded in 2008, PyOhio is a free annual Python programming language community conference based in Ohio. Content ranges from beginner to advanced and is intended to be relevant to all types of Python users: students, software professionals, scientists, hobbyists, and anyone looking to learn more.

Produced by NDV: https://youtube.com/channel/UCQ7dFBzZGlBvtU2hCecsBBg?sub_confirmation=1

Sat Jul 27 14:15:00 2024 at Orchid East

Comment