Bug Report: Failed dataset deletes still remove local rows and columns

未关闭 适合新手
#4,630 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@inchang-ing 已经在做这个了。

开始于 2026年10月18日。

  • #4633 来自 @inchang-ing —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
data

调研方向

从 Traceloop SDK 中的 HTTPClient.delete、Row.delete 和 Column.delete 开始,将它们的失败检查与 Datasets.delete_by_slug 进行比较。重现模拟的 503 和 403 响应,然后更新这两项检查,使本地状态得以保留并引发错误。运行现有的 dataset 测试,并为删除 row 和 column 时的失败添加或更新有针对性的回归测试。

由索引模型根据 Issue 内容生成。

描述

Which component is this bug for?

Traceloop SDK

Description

column.delete() removes the column and its values from the local dataset even when the delete request fails. row.delete() also removes the row on failure. Neither call raises an exception.

Reproduction steps

traceloop-sdk 0.62.4, with a mocked 503 response:

from unittest.mock import patch
import requests
from traceloop.sdk.client.http import HTTPClient
from traceloop.sdk.datasets.dataset import Dataset
from traceloop.sdk.datasets.column import Column
from traceloop.sdk.datasets.row import Row
from traceloop.sdk.datasets.model import ColumnType

http = HTTPClient("https://example.invalid", "test", "repro")
dataset = Dataset(http)
dataset.slug = "evaluation"
row = Row(http, dataset, "row-1", {"question": "What is 2 + 2?"})
column = Column(http, dataset, "question", "Question", ColumnType.STRING)
dataset.rows = [row]
dataset.columns = [column]
response = requests.Response()
response.status_code = 503
response._content = b'{}'

with patch("requests.delete", return_value=response):
    column.delete()

print(column.deleted, dataset.columns, row.values)
Expected behavior

Raise an error and leave the local rows, columns and values unchanged when the delete request fails.

Actual behavior

The HTTP error is logged, but column.delete() returns normally and prints:

True [] {}

The column is marked deleted and its values are gone. The same happens with a 403 response.

Python Version

3.12.14

Additional context

Also reproduced on main at 94d3f04. HTTPClient.delete returns False on failure, but Row.delete and Column.delete check for None. Datasets.delete_by_slug already checks the boolean result.

Have you spent some time to check if this bug has been raised before?
  • I checked and didn't find similar issue
Are you willing to submit PR?

Yes. Can I send a PR for these two checks?

主要语言
Python
星标
7.5k
派生
1.2k
平均合并
2 天 6 小时
30 天内合并 PR
2

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

traceloop/openllmetry 的其他 Issue

查看 traceloop/openllmetry 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。