forcedotcom / forcedotcom/SalesforcePy

Bulk API 2.0 always returns 'None' when getting Job successful/Failed/Unprocessed record results

Open
#57 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
115
Forks
38
PR merge metrics
No merged PRs in 30d

Description

When trying to get Job successful/Failed/Unprocessed record results, SalesforcePy always returns None.

Readthedocs documentation for SalesforcePy shows the usage here and states that a CSV with records is returned:
https://salesforcepy.readthedocs.io/en/latest/examples.html#get-job-successes

But when I directly make calls to the appropriate endpoints without using SalesforcePy, I get the correct results.
These are the very same endpoints that SalesforcePy is calling too.

It seems the problem is that SalesforcePy's BaseRequest.request method attempts to return the response in JSON under all circumstances

However, SF documentation states that when getting Job successful/Failed/Unprocessed record results, the response body is CSV:
https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/get_job_successful_results.htm

So in these cases, an exception is thrown in the BaseRequest.request method because the CSV cannot be converted to JSON, which in turn fails to update the response variable, and keeps on returning its default value of None

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.