SAP / SAP/python-pyodata

Multiple Issues with modify action for SAP SF OData API

Abierto
#136 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug
Lenguaje dominante
Python
Estrellas
268
Forks
100
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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:
SampleAppCode

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con EntitySetProxy.update_entity() y EntityModifyRequest; después, reproduce los ejemplos de actualización PUT, UPSERT y por lotes del issue y de la guía de uso. Comprueba el cuerpo del lote generado y el procesamiento de la respuesta; se considera terminado cuando se aceptan 200 actualizaciones, se reconoce UPSERT y se acepta la solicitud por lotes con un único change set sin el error de boundary.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
api
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.