Skip to content

Commit

Permalink
Release/v1.12.4 (#656)
Browse files Browse the repository at this point in the history
* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Fix typo in main README (#636)

* Bug/pyjwt dependency (#610)

* Update setup.py

Update pyjwt dependency

* Update setup.py

include cryptography for requirement for pyjwt

* Update setup.py

include pyjwt[crypto] in install requirements

* Update setup.py

remove [crypto] from pyjwt[crypto] in install_requires as causes travis-ci failure to build

* remove extra leading space

---------

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Updated __getattr__ function to create SFType object with object_pairs_hook (#634)

* Bug/pyjwt dependency (#610)

* Update setup.py

Update pyjwt dependency

* Update setup.py

include cryptography for requirement for pyjwt

* Update setup.py

include pyjwt[crypto] in install requirements

* Update setup.py

remove [crypto] from pyjwt[crypto] in install_requires as causes travis-ci failure to build

* Updated __getattr__ function to create SFType object with object_pairs_hook as input

Right now let us say that the user creates a SFType object using __getattr__ function which is present in the class SalesForce. If the SalesForce object is initiated using object_pairs_hook being dict or print. In that case the user would want the response from SFType to be same as that object as well. So I have added object_pairs_hook in the SFType object which is being called in the __getattr__ function of the SalesForce Class

* Updated __getattr__ function to create SFType object with object_pairs_hook

Right now let us say that the user creates a SFType object using getattr function which is present in the class SalesForce. If the SalesForce object is initiated using object_pairs_hook being dict or print. In that case the user would want the response from SFType to be same as that object as well. So I have added object_pairs_hook in the SFType object which is being called in the getattr function of the SalesForce Class

* removed whitespaces

* pylint

---------

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Fix indentation in setup.py (#618)

* Bug/pyjwt dependency (#610)

* Update setup.py

Update pyjwt dependency

* Update setup.py

include cryptography for requirement for pyjwt

* Update setup.py

include pyjwt[crypto] in install requirements

* Update setup.py

remove [crypto] from pyjwt[crypto] in install_requires as causes travis-ci failure to build

* Fix indent in setup.py

---------

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Update README.rst (#614)

* Update misspellings with codespell (#607)

See https://github.com/codespell-project/codespell

* fix: use unescaped username for JWT claim (#612)

* Bug/pyjwt dependency (#610)

* Update setup.py

Update pyjwt dependency

* Update setup.py

include cryptography for requirement for pyjwt

* Update setup.py

include pyjwt[crypto] in install requirements

* Update setup.py

remove [crypto] from pyjwt[crypto] in install_requires as causes travis-ci failure to build

* fix: use unescaped username for JWT claim

JWT Bearer Flow needs JWT claim sub containg unescaped username
Connected App Login has been fixed by #604

---------

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Add support for bulk 2.0 (#648)

* Release/v1.12.2 (#577)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Update api.py

fix missing password argument for connected app

* Release/v1.12.2 (#581)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Update api.py

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Additional documentation on using Simple Salesforce with Process Approvals REST API (#585)

* Adding in a documentation file that provides users with a walk through of how to use SimpleSalesforce to integrate with other SFDC REST endpoints.

* Updating content of code examples

Co-authored-by: tlange <tlange@qualtric.com>

* Update test_login.py

Update args for test_connected_app_login_success

* Update test_login.py

* Release/v1.12.3 (#606)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Update api.py

fix missing argument for connected app

* Fix infinite refresh session issue (#594)

* Release/v1.12.2 (#577)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Update api.py

fix missing password argument for connected app

* Release/v1.12.2 (#581)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Update api.py

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Additional documentation on using Simple Salesforce with Process Approvals REST API (#585)

* Adding in a documentation file that provides users with a walk through of how to use SimpleSalesforce to integrate with other SFDC REST endpoints.

* Updating content of code examples

Co-authored-by: tlange <tlange@qualtric.com>

* fix: infinite refresh session issue

Refresh session only when getting the status 401 and the error code INVALID_SESSION_ID
Fixes #569

* Simplify the fix code

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>

* Fix _add_autosized_batches to include all records, and add tests (#591)

Previously _add_autosized_batches missed out a single record when
creating batches for record sets containing more than one record. I
haven't worked out why, but this is a slight re-implementation that now
works.

The previous implementation had no test coverage so this commit also
adds tests that do the following:

* ensure that when batch_size is passed as auto, that
  _add_autosized_batches is called appropriately
* ensures that when batching all records are accounted for in the
  resulting batches, both by record count and then by flattening the
  batches and comparing values
* ensures that every batch is within the record and size limits
* ensures that except for the last batch, every batch has either the
  maximum number of records (10,000) or that adding another record would
  tip it over the character count limit

Fixes #590.

* Replace Authlib with PyJWT (#537)

* Strip leading v from api_version (#522)

* Strip leading v from api_version

Strip leading v from version before templating into url. Including the 
leading v in the api_version in url results in the server responding with 
API V7.0 in the server_url

* fix string formatting

Fix string formatting

* Replace silent version correction with Exception

Raise an exception when sf_version is specified with a leading 'v', since 
specifying a version with the leading 'v' leads to surprising behavior in
Salesforce.

* Update .travis.yml

Add python 3.9,3.10, and 3.11 to travis-ci

* Update README.rst

Add python 3.9,3.10, and 3.11 to readme

* Update login.py

removed unused header in connected app login

* Update setup.py

update classifiers

* Update setup.py

replace nose with pytest

* Update setup.py

update test_suite

* Update test_login.py

set password for test_connected_app_login_failure

* Update test_login.py

* Update test_login.py

typo in password arg

* Use f-strings (#597)

* Use f-strings

since minimal supported version is already Python 3.6.

* Avoid breaking strings

as much as possible within 80 columns.

* Update for release/v1.12.3 branch

* Fix escaped username and password (#604)

* Release/v1.12.2 (#577)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Update api.py

fix missing password argument for connected app

* Release/v1.12.2 (#581)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Update api.py

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Additional documentation on using Simple Salesforce with Process Approvals REST API (#585)

* Adding in a documentation file that provides users with a walk through of how to use SimpleSalesforce to integrate with other SFDC REST endpoints.

* Updating content of code examples

Co-authored-by: tlange <tlange@qualtric.com>

* Update test_login.py

Update args for test_connected_app_login_success

* Update test_login.py

* Fix escaped username and password

- Connected App Login (OAuth Username-Password Flow) uses non-escape username and password value
- Fixes #600

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>

* Use pathlib.Path (#599)

also:
- default encoding in bytes.decode is already 'utf-8'. See
  https://docs.python.org/3.6/library/stdtypes.html#bytes.decode

Available at least since Python 3.6, which is the minimal supported
version.

* Fix upsert metadata (#603)

* Release/v1.12.2 (#577)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Update api.py

fix missing password argument for connected app

* Release/v1.12.2 (#581)

* Remove leftover reference to Python 3.5 support (#563)

Support for Python 3.5 was dropped in #556, so it should not be listed
as a supported version in the README.

* Update CHANGES

* Feature/v1.12.2/connected app login (#574)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Bug/v1.12.2/bulk autosize batch (#575)

* add waits as arguments to exposed bulk api methods (#565)

* add waits as arguments to simple salesforce top level queries

* fix missing wait pass-through

* obey line length rules

* clean up trailing whitespace

* Update CHANGES

* Update bulk.py

fix adding of int to string in bulk autosize batches

* Update bulk.py

fix autosize batching

* Update bulk.py

add ability to bypass results being returned

* Update bulk.py

Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>

* Feature/v1.12.2/connected app login (#576)

* add support for connected app

Add connected app support

* add connected app support

add connected app support

* Update __version__.py

* add tests for connected app login

* clean up formatting

* clean up formatting

* Update login.py

fix pylint errors

* Update api.py

fix pylint errors

* Update CHANGES

* Update README.rst

update read me for connected app and helper functions/related recordsq uery

* Avoid a ZeroDivisionError in bulk.py (#568)

* Raise an error if no data provided in bulk queries

* Update bulk.py

fix trailing whitespace

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>

* Update api.py

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>

* Additional documentation on using Simple Salesforce with Process Approvals REST API (#585)

* Adding in a documentation file that provides users with a walk through of how to use SimpleSalesforce to integrate with other SFDC REST endpoints.

* Updating content of code examples

Co-authored-by: tlange <tlange@qualtric.com>

* Update test_login.py

Update args for test_connected_app_login_success

* Update test_login.py

* Fixes: #602

upsert of metadataType wrongly calls updateMetadata. It should be upsertMetadata.

* Update login.py

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>

* Update __version__.py

Version Update

* Update CHANGES

Update changes

* Update syntax for Python 3.6+ (#605)

* Update syntax for Python 3.6+

using pyupgrade. Use `yield from`.
See https://github.com/asottile/pyupgrade#yield--yield-from

Remove redundant generator parenthesis.

Also remove unused `login_token_request_data` variable, and change
corresponding variables names to `token_data`, as different names were
being used and might have let to the confusion around the unused one.

* Remove redundant `$` from end of regular expression

* Update login.py

fix missing f-string and remove duplicate connected app elif logic

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Hiroki Kajiwara <hkajiwara@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>
Co-authored-by: Alex Dutton <gh@alexdutton.co.uk>
Co-authored-by: thatguysimon <snizov@twistbioscience.com>
Co-authored-by: Hamilton Kibbe <hamilton.kibbe@gmail.com>
Co-authored-by: Eric Nielsen <4120606+ericbn@users.noreply.github.com>

* Bug/pyjwt dependency (#610)

* Update setup.py

Update pyjwt dependency

* Update setup.py

include cryptography for requirement for pyjwt

* Update setup.py

include pyjwt[crypto] in install requirements

* Update setup.py

remove [crypto] from pyjwt[crypto] in install_requires as causes travis-ci failure to build

* Add support for bulk 2.0

* Add documents for bulk 2.0

* Fix pylint static error

* Update .pylintrc, disable `broad-exception-raised`

* Add enhancements for bulk 2.0

* Add enhancements for bulk 2.0

* Fix pylint static error

* Fix pylint check error

* Update dependencies

* Fix parallel ingest jobs error

* Add support for download records directly

* Fix `no-self-use` removed for pylint~=2.14

* Update documents for bulk 2.0

* Update enumerate types

* Add support for downloading ingest record results directly

* Update documents for bulk 2.0

---------

Co-authored-by: JonWobken <49450080+jon-wobken@users.noreply.github.com>
Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>
Co-authored-by: Hiroki Kajiwara <hkajiwara@gmail.com>
Co-authored-by: Alex Dutton <gh@alexdutton.co.uk>
Co-authored-by: thatguysimon <snizov@twistbioscience.com>
Co-authored-by: Hamilton Kibbe <hamilton.kibbe@gmail.com>
Co-authored-by: Eric Nielsen <4120606+ericbn@users.noreply.github.com>

* added support for list of dictionary in upsert/update/insert/delete methods

* fixed pylint errors, converted list compression to set compression, added docstring to _convert_dict_to_csv

* Update metadata.py

disable broad-exception raised

* Update metadata.py

_retrieve_deploy_result - pylint: disable=broad-exception-raised

* Update CHANGES

* Update __version__.py

* Revert "Merge branch 'feature/bulk_api_2.0' into release/v1.12.4"

This reverts commit 3e61565, reversing
changes made to 2360173.

---------

Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
Co-authored-by: Lewington-pitsos <lewingtonpitsos@gmail.com>
Co-authored-by: Eric Liprandi <82050188+ericl-billgo@users.noreply.github.com>
Co-authored-by: Purujit <41872519+GuptaPurujit@users.noreply.github.com>
Co-authored-by: Charles Chan <charleswhchan@users.noreply.github.com>
Co-authored-by: Brendan McDonald <45665356+wbmcdonald4@users.noreply.github.com>
Co-authored-by: Eric Nielsen <4120606+ericbn@users.noreply.github.com>
Co-authored-by: Hiroki Kajiwara <hkajiwara@gmail.com>
Co-authored-by: wang zhiwei <noparking188@gmail.com>
Co-authored-by: Vandan <vandanadhvaryu99@gmail.com>
Co-authored-by: langet0695 <77029254+langet0695@users.noreply.github.com>
Co-authored-by: tlange <tlange@qualtric.com>
Co-authored-by: Alex Dutton <gh@alexdutton.co.uk>
Co-authored-by: thatguysimon <snizov@twistbioscience.com>
Co-authored-by: Hamilton Kibbe <hamilton.kibbe@gmail.com>
  • Loading branch information
16 people committed May 17, 2023
1 parent c574233 commit e3393bb
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 38 deletions.
14 changes: 14 additions & 0 deletions CHANGES
@@ -1,3 +1,17 @@
v1.12.4
======
Bug Fixes
--------
- [#612] Fix unescaped username for JWT claim

Other
--------
- [#636] Fix README typos
- [#634] Added object_pairs_hook to SFType
- [#618] Fixed indentation in setup.py
- [#614] Updated README with tutorial video
- [#607] Fixed misspellings

v1.12.3
======
Bug Fixes
Expand Down
13 changes: 10 additions & 3 deletions README.rst
Expand Up @@ -341,7 +341,7 @@ Then you can use this to deploy that zipfile:
asyncId = result.get('asyncId')
state = result.get('state')
Both deploy and checkDeployStatus take keyword arguements. The single package arguement is not currently available to be set for deployments. More details on the deploy options can be found at https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm
Both deploy and checkDeployStatus take keyword arguments. The single package argument is not currently available to be set for deployments. More details on the deploy options can be found at https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_deploy.htm

You can check on the progress of the deploy which returns a dictionary with status, state_detail, deployment_detail, unit_test_detail:

Expand Down Expand Up @@ -419,7 +419,7 @@ To retrieve a list of top level description of instance metadata, user:
Using Bulk
--------------------------

You can use this library to access Bulk API functions. The data element can be a list of records of any size and by default batch sizes are 10,000 records and run in parrallel concurrency mode. To set the batch size for insert, upsert, delete, hard_delete, and update use the batch_size argument. To set the concurrency mode for the salesforce job the use_serial argument can be set to use_serial=True.
You can use this library to access Bulk API functions. The data element can be a list of records of any size and by default batch sizes are 10,000 records and run in parallel concurrency mode. To set the batch size for insert, upsert, delete, hard_delete, and update use the batch_size argument. To set the concurrency mode for the salesforce job the use_serial argument can be set to use_serial=True.

Create new records:

Expand All @@ -443,7 +443,7 @@ Update existing records:
sf.bulk.Contact.update(data,batch_size=10000,use_serial=True)
Update existing records and update lookup fields from an external id field:
Update existing records and update lookup fields from an external id field:

.. code-block:: python
Expand Down Expand Up @@ -665,6 +665,13 @@ Generate Pandas Dataframe from SFDC Bulk API Query (ex.bulk.Account.query)
df = pd.DataFrame.from_dict(data,orient='columns').drop('attributes',axis=1)
YouTube Tutorial
--------------------------
Here is a helpful `YouTube tutorial`_ which shows how you can manage records in bulk using a jupyter notebook, simple-salesforce and pandas.

This can be a effective way to manage records, and perform simple operations like reassigning accounts, deleting test records, inserting new records, etc...

.. _YouTube tutorial: https://youtu.be/nPQFUgsk6Oo?t=282

Authors & License
--------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/other_REST_examples.rst
Expand Up @@ -5,7 +5,7 @@ In addition to built in functions that allow integrations with the Salesforce Ap

.. _SFDC Submit documentation: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals_submit.htm

1. Import any dependant packages to your script. For this example we use Simple Salesforce, Requests and the built in JSON package:
1. Import any dependent packages to your script. For this example we use Simple Salesforce, Requests and the built in JSON package:

.. code-block:: python
Expand Down
61 changes: 30 additions & 31 deletions setup.py
Expand Up @@ -26,34 +26,33 @@
package_data={
'simple_salesforce': ['metadata.wsdl'],
},
install_requires = [
'requests>=2.22.0',
'cryptography',
'zeep',
'pyjwt'
],
tests_require = [
'pytest',
'pytz>=2014.1.1',
'responses>=0.5.1',
'cryptography<3.4',
],
test_suite = 'simple_salesforce.tests',
keywords = about[
'__keywords__'],
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: PyPy'
]
)
install_requires = [
'requests>=2.22.0',
'cryptography',
'zeep',
'pyjwt'
],
tests_require = [
'pytest',
'pytz>=2014.1.1',
'responses>=0.5.1',
'cryptography<3.4',
],
test_suite = 'simple_salesforce.tests',
keywords = about['__keywords__'],
classifiers = [
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Topic :: Internet :: WWW/HTTP',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: PyPy'
]
)
2 changes: 1 addition & 1 deletion simple_salesforce/__version__.py
Expand Up @@ -5,7 +5,7 @@
__title__ = 'simple-salesforce'
__description__ = 'A basic Salesforce.com REST API client.'
__url__ = 'https://github.com/simple-salesforce/simple-salesforce'
__version__ = '1.12.3'
__version__ = '1.12.4'
__author__ = 'Nick Catalano'
__author_email__ = 'nickcatal@gmail.com'
__license__ = 'Apache 2.0'
Expand Down
3 changes: 2 additions & 1 deletion simple_salesforce/api.py
Expand Up @@ -319,7 +319,8 @@ def __getattr__(self, name):

return SFType(
name, self.session_id, self.sf_instance, sf_version=self.sf_version,
proxies=self.proxies, session=self.session, salesforce=self)
proxies=self.proxies, session=self.session, salesforce=self,
object_pairs_hook=self._object_pairs_hook)

# User utility methods
def set_password(self, user, password):
Expand Down
2 changes: 1 addition & 1 deletion simple_salesforce/login.py
Expand Up @@ -171,7 +171,7 @@ def SalesforceLogin(
expiration = datetime.now(timezone.utc) + timedelta(minutes=3)
payload = {
'iss': consumer_key,
'sub': username,
'sub': unescape(username),
'aud': f'https://{domain}.salesforce.com',
'exp': f'{expiration.timestamp():.0f}'
}
Expand Down
3 changes: 3 additions & 0 deletions simple_salesforce/metadata.py
Expand Up @@ -30,6 +30,7 @@ def __init__(self, name, service, zeep_type, session_header):
self._session_header = session_header

@staticmethod
# pylint: disable=broad-exception-raised
def _handle_api_response(response):
"""
Parses SaveResult and DeleteResult objects to identify if there was
Expand Down Expand Up @@ -326,6 +327,7 @@ def _read_deploy_zip(zipfile):
raw = Path(zipfile).read_bytes()
return b64encode(raw).decode()

# pylint: disable=broad-exception-raised
def _retrieve_deploy_result(self, async_process_id, **kwargs):
""" Retrieves status for specified deployment id
:param async_process_id:
Expand Down Expand Up @@ -503,6 +505,7 @@ def retrieve(self, async_process_id, **kwargs):

return async_process_id, state

# pylint: disable=broad-exception-raised
def retrieve_retrieve_result(self, async_process_id, include_zip, **kwargs):
""" Retrieves status for specified retrieval id """
client = kwargs.get('client', 'simple_salesforce_metahelper')
Expand Down

0 comments on commit e3393bb

Please sign in to comment.