Skip to content

Conversation

@y-t99
Copy link

@y-t99 y-t99 commented Apr 28, 2022

add fields.create, fields.delete, datasheet.create interface and test example.

@@ -1,3 +1,10 @@
class SpaceInfoLack(Exception):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个错误不需要专门定义一个 Exception,算是 client 参数校验的问题。直接 raise Erorr("具体的信息和正确的做法") 。缺少空间信息, 这个说法太模糊,直接 vika.datasheet("dstId") => vika.space("spaceID").datasheet("dstId") 告诉用户怎么修改更好。

Exception 更加倾向于表示服务端抛出的错误。预期偶尔出现,用户需要 catch 解决的异常流程。

:example:
>>> vika = Vika('YOUR_API_TOKEN')
>>> req_data = {'name': 'table_name'}
>>> rep = vika.space('YOUR_SPACE_ID').datasheet.create(req_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datasheets

@mayneyao mayneyao merged commit 56ca0ef into vikadata:master Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants