appwrite / appwrite/sdk-for-python

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

Đang mở
#139 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Python
Star
268
Fork
67
Merge trung bình
11 giờ 59 phút
Pull request đã merge (30 ngày)
2

Mô tả

### 👟 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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xác định model Row của Pydantic và đường đi của TablesDB.create_row(), sau đó so sánh dạng phản hồi được tạo ra khi transaction_id được cung cấp với các trường bắt buộc của model. Xác nhận bản sửa bằng cách tái hiện lời gọi transaction create_row() và kiểm tra rằng phản hồi của nó được deserialize mà không có các lỗi validation đối với $createdAt và $updatedAt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.