Skip to content

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

@MattTrip

Description

@MattTrip

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions