Linh Pham · @qlp
519 followers · 3148 posts · Server linh.social

I've been working on getting my Stats API to work with 2 and was wondering why it was erroring out on one specific endpoint.

Turns out, it was a bug I introduced back when I was trying to optimize the `wwdtm` library and, if there was no data returned from a query, the key would be set to an empty list.

The problem? It's supposed to be an empty dictionary.

I had typed `[]` instead of `{}`.

😒😒😒

#waitwait #pydantic #python #fail

Last updated 1 year ago

Pydantic · @pydantic
408 followers · 34 posts · Server fosstodon.org

🐱 On this we just wanted to share this adorable issue we've had sometime ago. It's the purr-fect one for today. 😻

We need more cats as avatars 🐾

🐾🐈‍⬛🐾

#caturday #pydantic #opensource #furbuddies #catsofgithub

Last updated 1 year ago

Pydantic · @pydantic
408 followers · 34 posts · Server fosstodon.org

Spreading the good vibes at the Sentry + FastAPI Berlin Meetup by @getsentry with the incredible trio: @marcelotryle, @samuelcolvin, and @hasanramezani! 💫✨

Learning, connecting, and having fun together as a team.

" 📸🤝😄

#meetup #pydantic #sentry #fastapi #opensource #goodvibesonly

Last updated 1 year ago

Pydantic · @pydantic
398 followers · 30 posts · Server fosstodon.org

BTW, there is a brief road map for the near future of Pydantic development. If you would like to take a glimpse into a couple of future Pydantic releases then here it is github.com/pydantic/pydantic/i.

#pydantic #opensource #roadmap

Last updated 1 year ago

Pydantic · @pydantic
390 followers · 28 posts · Server fosstodon.org

There are many ways you can ask for help using Pydantic. Here are some of them:
- 💬 reply to this message
- 🏷️ share a post in Fediverse tagging it
- :github: ask a question on GIthub Discussions github.com/pydantic/pydantic/d
- 🎙️ join our Discord server discord.gg/FYb2EtV2

Anyway, follow this account and have a nice week! 👋🏻

#pydantic #python #opensource #community #programming

Last updated 1 year ago

Pydantic · @pydantic
389 followers · 27 posts · Server fosstodon.org

Hey all!

How is you Monday going so far? How are you doing migrating from Pydantic v1 to Pydantic v2?

Today is a good time to tell us about issues you have migrating to v2 or just using Pydantic in general.

🧵⏩

#pydantic #python #opensource #community #programming

Last updated 1 year ago

gram · @orsinium
124 followers · 636 posts · Server fosstodon.org

@jcristharif Msgspec is great, thank you for your work. I also praised msgspc a few months ago:

t.me/itgram_channel/597

Do you have plans to update benchmarks to use v2? I'm curious how well it holds up.

#pydantic

Last updated 1 year ago

Michał Górny · @mgorny
186 followers · 853 posts · Server pol.social

Myślicie, że jest wam dzisiaj gorąco?

Najpierw walczyłem z nowym segfaultem w 2 z Pythonem 3.12. Nie udało mi się zajść daleko, co najwyżej ustalić, że to .

github.com/pydantic/pydantic/i

Potem testowałem świeży snapshot — tylko po to, by odkryć, że testy znów padly na 32-bitowych platformach. Po bisect'cie, okazało się, że przyczyną była zmiana "NFCi" (niezamierzająca zmian funkcjonalnych) do logiki hashowania — wygląda na to, że LLVM drukuje teraz funkcje w kolejności zależnej od platformy.

reviews.llvm.org/D158217#46009

Na koniec walczyłem z segfaultem w testach . Najwyraźniej jest to regresja związana z betą 1.26.0, więc wypracowałem backtrace i zgłosiłem błąd.

github.com/numpy/numpy/issues/

#python #gentoo #numpy #trimesh #llvm #heisenbug #pydantic

Last updated 1 year ago

gram · @orsinium
117 followers · 559 posts · Server fosstodon.org

@raiderrobert

Wrestling with to make an adapter serializer that uses for validation.

DRF embodies all the worst things about Java-style OOP. There are base classes, mixins, attributes that must not be used before you call a specific methods, nothing is documented, and, of course, not annotated. Even drf-stubs project that supposed to annotate DRF is full of Any. And then we also stuck with pydantic v1 where you can't have custom serializers.

What a day.

#djangorestframework #pydantic

Last updated 1 year ago

Timothée Mazzucotelli :python: · @pawamoy
140 followers · 218 posts · Server fosstodon.org

I just published a first prototype of a extension for : mkdocstrings.github.io/griffe-

My sponsors can immediately start using it 🙂 It's version 1.0.0a0, so still experimental!

It will change a bit the look of Pydantic models within mkdocstrings:

#Griffe #pydantic

Last updated 1 year ago

cauf 🇷🇺 · @cauf
374 followers · 302 posts · Server lor.sh

сегодня для одного своего проекта сделал енкодер, который позволяет BaseSettings сериализовывать в валидный toml.

Что это дает?

1. Вы можете не описывать отдельно файл настроек и его шаблон, и все время сверять, правильно ли матчится файл со структурой данных, а просто сгенернировать файл настроек из структуры, заполненный дефолтными значениями.

2. Добавил функцию добавления описания каждого параметра настроек из аттрибутов Field.title и Field.description в виде ведущих комментариев. Теперь не нужно отдельно лезть на сайт, что бы посмотреть описание параметров - они все уже есть в сгенерированном файле настроек!

В качестве примера:

Допустим, у нас есть вот такая структура данных:

```python
class ImportsSettings(BaseSettings):
is_sorted: bool = Field(
default=True,
title='Сортировка импортов',
description=(
'Определяет, будет ли отсортированы строки импорта. Сортирует в пределах каждой области видимости. '
'Т.е. сортировка будет выполнена независимо для модуля, каждой функции и класса с любой степенью вложения. '
'По-умолчанию True.'
),
)

class StyleSettings(BaseSettings):
line_length: int = Field(80, title='Длинна строки', description='Максимальная длинна одной строки кода')
imports: ImportsSettings = Field(default_factory=ImportsSettings, title='Настройки ипортов')
```

после генерации получим вот такой toml-файл

```toml
### Длинна строки
# Максимальная длинна одной строки кода
line_length = 80

[imports]
### Сортировка импортов
# Определяет, будет ли отсортированы строки импорта. Сортирует в пределах
# каждой области видимости. Т.е. сортировка будет выполнена независимо для
# модуля, каждой функции и класса с любой степенью вложения. По-умолчанию
# True.
is_sorted = true
```

#python #ru_python #pydantic

Last updated 1 year ago

Serge Matveenko ♻️☮️Ⓐ · @lig
262 followers · 2883 posts · Server fosstodon.org

🎧 Hey! There is the official Pydantic Discord server if you fancy it.

👉🏻 Join via link: discord.gg/FYb2EtV2

🏷️

#pydantic #python #community #discord #opensource #programming

Last updated 1 year ago

Timothée Mazzucotelli :python: · @pawamoy
138 followers · 203 posts · Server fosstodon.org

I've completely reworked the extension system of , to make it easier to use.

To test it before releasing anything, I prototyped a extension. Here's a preview of the result in 🤩

#Griffe #pydantic #mkdocstrings

Last updated 1 year ago

Michał Górny · @mgorny
113 followers · 396 posts · Server pol.social

Co więcej, 2 wymaga . Musiałem zamaskować 6 paczek, i wyłączyć niektóre funkcje w 4 kolejnych na profilach WD40.

Jakimś cudem jeszcze nie straciliśmy (było blisko).

gitweb.gentoo.org/repo/gentoo.

#python #setuptools #gentoo #rustlang #pydantic

Last updated 1 year ago

Michał Górny · @mgorny
113 followers · 395 posts · Server pol.social

Wiecie, że 2 wyszło parę dni temu? Dziś wziąłem się za przetestowanie wstecznych zależności w i zaraz wyjdzie na ~arch.

A teraz rant:

Wielki korpoprojekt z budżetem i zatrudnionymi programistami: dodają "< 2" do zależności, nic się od tego czasu nie dzieje.

Mały hobbystyczny projekt: daje "< 2" jako chwilowe rozwiązanie, naprawia zgodność dnia następnego.

#python #gentoo #pydantic

Last updated 1 year ago

Alexander Nowak :python: · @alenowak
19 followers · 273 posts · Server masto.ai

First bugfix release of 2 s out: t.co/kaCA9otUf4

#pydantic

Last updated 1 year ago

Lawouach · @lawouach
82 followers · 299 posts · Server fosstodon.org

Started the big migration from v1 to v2 in Reliably. Started with a small code base but next will be a major one internally. Let's hope this is smooth

#pydantic #python

Last updated 1 year ago

Lawouach · @lawouach
82 followers · 299 posts · Server fosstodon.org

@berkes @ashwinvis My guess is that they will create other tools with a backend.

They show how the GH stars grew so quickly (VC love this)

My other guess is that this will make the company valuable enough they will see a fast exit from a larger player buying them.

You'll see this happening with too likely.

#rust #pydantic

Last updated 1 year ago

Koudai Aono · @koxudaxi
14 followers · 17 posts · Server fosstodon.org

I have released `datamodel-code-generator` version `0.21.0` for v2.
The version can generate the v2 models from JSONSchema/OpenAPI/JSON/YAML
Also, The version can be run in V2.

The changes are in the link.
github.com/koxudaxi/datamodel-

#pydantic #pydanticv2

Last updated 1 year ago

Jason Morris · @lexpedite
174 followers · 543 posts · Server law.builders

Can someone familiar with advise whether I need to use in langchain and JSON Schema for OpenAI functions? Or if I can get away with just pydantic and make the specific less important?

#langchain #pydantic #llm #gpt

Last updated 1 year ago