appwrite / appwrite/sdk-for-python

🐛 Bug Report: `create_row` with `transaction_id` fails — Pydantic Row model requires $createdAt / $updatedAt but transactional responses omit them

オープン
#139 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Python
スター
268
フォーク
67
平均マージ
11時間 59分
マージ済み PR(30日)
2

説明

### 👟 Reproduction steps

- Create a transaction via `TablesDB.create_transaction()`
- Call `TablesDB.create_row(...)` with a transaction_id
- The SDK's Pydantic Row model fails to deserialize the response

### 👍 Expected behavior

`create_row()` to work inside a transaction?

### 👎 Actual Behavior

Throws this error when calling `create_row()`

```
2 validation errors for Row
$createdAt
Field required [type=missing, input_value={'$id': '69c435146902e250...ns': [], '$sequence': 0}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
$updatedAt
Field required [type=missing, input_value={'$id': '69c435146902e250...ns': [], '$sequence': 0}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.12/v/missing
```

### 🎲 Appwrite version

Different version (specify in environment)

### 💻 Operating system

Linux

### 🧱 Your Environment

Appwrite version: 16.0.0
Python 3.12
Ubuntu-24.04, self-hosted, function ran locally with `appwrite run functions`

### 👀 Have you spent some time to check if this issue has been raised before?

- [x] I checked and didn't find similar issue

### 🏢 Have you read the Code of Conduct?

- [x] I have read the [Code of Conduct](https://github.com/appwrite/appwrite/blob/master/CODE_OF_CONDUCT.md)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず Pydantic の Row モデルと TablesDB.create_row() の処理経路を見つけ、次に transaction_id が指定された場合に生成されるレスポンスの形状をモデルの必須フィールドと比較します。transaction create_row() 呼び出しを再現し、そのレスポンスが $createdAt と $updatedAt のバリデーションエラーなしにデシリアライズされることを確認して、修正を検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。