Multiple Issues with modify action for SAP SF OData API
还没有人认领这个 Issue。
评估
调研方向
从 EntitySetProxy.update_entity() 和 EntityModifyRequest 开始,然后复现 issue 和使用指南中的 PUT、UPSERT 以及批量更新示例。检查生成的批量请求体和响应处理;当 200 个更新被接受、UPSERT 被识别,并且包含单个 change set 的批量请求在没有 boundary 错误的情况下被接受时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I am using this library for developing a Python application that uses SAP SuccessFactors OData API. I spent last few days to resolve following issues with performing modify/update action but without any success. I finally came here to seek your help and suggestion. Please note that my application is already using this library for several OData query operations but I would prefer to use it also for update, create and delete operations too.
-
Single update request using "PUT" method is making the desired update into HttpError because the status code returned is 200 instead of 204. This is because the update_entity() function in the class EntitySetProxy expects it to be 204 always.
-
SAP SuccessFactors expects a custom method called "UPSERT" but the EntityModifyRequest class identifies it as invalid method.
-
Batch update request even with only one update changeset is failing with the "BadRequestException" (400) error : "Missing boundary delimiter at line '4'.". Code wise all looks good and as suggested in the usage guide. Also, the header as well as the body (prints as below in [] parentheses) of the batch request looks fine too. Could it be because of 2 line breaks on line 4 of the body?
Batch Req. Header: [{'Content-Type': 'multipart/mixed;boundary=batch_1850_4989_2562'}]
Batch Req. Body: [
--batch_1850_4989_2562
Content-Type: multipart/mixed;boundary=changeset_2364_6806_2818
--changeset_2364_6806_2818
Content-Type: application/http
Content-Transfer-Encoding:binary
PUT PickListValueV2(PickListV2_effectiveStartDate=datetime'2020-10-23T00:00:00',PickListV2_id='employeeGroup',externalCode='EX') HTTP/1.1
Accept: application/json
Content-Type: application/json
{"label_en_DEBUG": "External Employee", "status": "A"}
--changeset_2364_6806_2818--
--batch_1850_4989_2562--]
Sample Code:

- 主要语言
- Python
- 星标
- 268
- 派生
- 100
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SAP/python-pyodata 的其他 Issue
-
chore
难度 2/5 1-3 小时 新手友好度 78/100
SAP/python-pyodata#304 ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
SAP/python-pyodata#108 ·
-
chore
SAP/python-pyodata#302 · 已指派 1 人 ·
-
question
SAP/python-pyodata#294 · 1 条评论 · 已指派 1 人 ·
-
bug
SAP/python-pyodata#282 · 2 条评论 · 已指派 1 人 ·
查看 SAP/python-pyodata 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·