Giter VIP home page Giter VIP logo

Comments (7)

zhaoche27 avatar zhaoche27 commented on August 22, 2024 2

pip install larksuite-oapi==1.0.32 @Lips7

from oapi-sdk-python.

zhaoche27 avatar zhaoche27 commented on August 22, 2024 1

{
"revision": 0,
"spreadsheetToken": "",
"valueRange": {
"majorDimension": "ROWS",
"range": "
",
"revision": 0,
"values": [
[
"***"
]
]
}
}

values 是一个 二维数组,是吧?

from oapi-sdk-python.

zqjy avatar zqjy commented on August 22, 2024

代码:
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.

zqjy avatar zqjy commented on August 22, 2024

查看了源码之后发现请求成功了但是解析respone的时候出问题了因为values_get会返回一个list

from oapi-sdk-python.

Lips7 avatar Lips7 commented on August 22, 2024

有同样的问题😭,辛苦开发者帮忙看一下,sheet api 里 values_get后返回list,没法直接类型推断,list对象没有__args__属性,只有list[str]才会有,这里可能需要捕获一下异常直接退出然后返回原始的数据类型

from oapi-sdk-python.

zhaoche27 avatar zhaoche27 commented on August 22, 2024

好的,谢谢你的反馈,给提供反馈的json数据吗,伪数据就行,结构对的就行,数据是假的,我来测试一下, utils/dt.py

from oapi-sdk-python.

Lips7 avatar Lips7 commented on August 22, 2024

{ "revision": 0, "spreadsheetToken": "", "valueRange": { "majorDimension": "ROWS", "range": "", "revision": 0, "values": [ [ "***" ] ] } }

values 是一个 二维数组,是吧?

是的

from oapi-sdk-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.