Comments (7)
pip install larksuite-oapi==1.0.32 @Lips7
from oapi-sdk-python.
{
"revision": 0,
"spreadsheetToken": "",
"valueRange": {
"majorDimension": "ROWS",
"range": "",
"revision": 0,
"values": [
[
"***"
]
]
}
}
values 是一个 二维数组,是吧?
from oapi-sdk-python.
代码:
from larksuiteoapi.api import Config, DOMAIN_FEISHU
from larksuiteoapi.service.sheets.v2 import Service
response = (
Service(
Config(
DOMAIN_FEISHU,
Config.new_internal_app_settings(
app_id="cli_xxx",
app_secret="xxx",
),
)
)
.spreadsheetss.values_get(user_access_token=_token)
.set_spreadsheetToken("xxx")
.set_range("xxx!A1:C10")
.do()
)
报错如下:
Traceback (most recent call last):
File "/PycharmProjects/pythonProject/lark_sheets.py", line 35, in
.set_range("xxx!A1:C10")
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/service/sheets/v2/api.py", line 1487, in do
resp = req.do(conf)
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/api/request/request.py", line 175, in do
return Handlers(conf, self).handle()
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/api/request/request.py", line 331, in handle
raise e
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/api/request/request.py", line 326, in handle
self.send()
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/api/request/request.py", line 253, in send
self.parse_response()
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/api/request/request.py", line 301, in parse_response
resp.data = make_datatype(self.req.output_class, resp_json.get('data'))
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 95, in make_datatype
d[att_name] = make_datatype(att.type, att_value)
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 95, in make_datatype
d[att_name] = make_datatype(att.type, att_value)
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 82, in make_datatype
return [make_datatype(t.args[0], i) for i in kwargs]
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 82, in
return [make_datatype(t.args[0], i) for i in kwargs]
File "/opt/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 82, in make_datatype
return [make_datatype(t.args[0], i) for i in kwargs]
File "/anaconda3/envs/py37/lib/python3.7/site-packages/larksuiteoapi/utils/dt.py", line 82, in
return [make_datatype(t.args[0], i) for i in kwargs]
AttributeError: '_SpecialForm' object has no attribute 'args'
from oapi-sdk-python.
查看了源码之后发现请求成功了但是解析respone的时候出问题了因为values_get会返回一个list
from oapi-sdk-python.
有同样的问题😭,辛苦开发者帮忙看一下,sheet api 里 values_get后返回list,没法直接类型推断,list对象没有__args__
属性,只有list[str]才会有,这里可能需要捕获一下异常直接退出然后返回原始的数据类型
from oapi-sdk-python.
好的,谢谢你的反馈,给提供反馈的json数据吗,伪数据就行,结构对的就行,数据是假的,我来测试一下, utils/dt.py
from oapi-sdk-python.
{ "revision": 0, "spreadsheetToken": "", "valueRange": { "majorDimension": "ROWS", "range": "", "revision": 0, "values": [ [ "***" ] ] } }
values 是一个 二维数组,是吧?
是的
from oapi-sdk-python.
Related Issues (20)
- 这个能接入飞书吗
- service层能不能有个文档啊? HOT 1
- 使用API进行文档 sheet 页面新建或删除,会报错 HOT 1
- 是否可以一些文档,demo...
- Transport cannot deal with utf-8 request body HOT 1
- lark-oapi (v2 main分支)和 larksuite-oapi(main分支)的区别?
- 使用client.im.v1.message_resource.get(request)方法获取文件时,提示AttributeError: 'RawResponse' object has no attribute 'header'
- 执行update请求的时候raise exception
- 如果用django来替代flask应该怎么实现? HOT 2
- 支持Async的请求方式,httpx/aiphttp HOT 2
- RefreshAccessToken got invalid request
- GetAuthorizeRequest 这个方法的返回值是不是调整了 返回的 并不是预期的json格式而是html 导致序列化的时候报错了
- use response.data Got AttributeError: 'InternalAppAccessTokenResponse' object has no attribute 'data' HOT 1
- 怎么获取到飞书文档的授权码
- missing message_id in responsebody
- 感觉封装的不太行,用原生自己封装更好使,就怕接口调整 HOT 1
- [feature request] Add some Enum types
- Feature Request: Have some way to get user_access_token
- im.message.message_read_v1 订阅消息已读事件报错
- How to use `filter`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oapi-sdk-python.