SAP / SAP/python-pyodata

Delete Request in Batch Mode, need header

Open
#65 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
268
Forks
100
PR merge metrics
No merged PRs in 30d

Description

Hello,

when we run delete requests in Batch Mode, it raises an exception:

...service.py", line 57, in encode_multipart
for hdr, hdr_val in req.get_headers().items():
AttributeError: 'NoneType' object has no attribute 'items'

So we need to define the get_header() method for EntityDeleteRequest(ODataHttpRequest), e.g. like this:

def get_headers(self):
return {'Accept': 'application/json'}

I would like to pull a request and do the bugfix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read service.py around line 57, where encode_multipart calls req.get_headers(), and inspect EntityDeleteRequest. Confirm the batch delete path currently receives no headers; done means it no longer raises the NoneType exception and supplies the expected Accept header.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.