This PR explores two ways that simplejson could be removed from the dependency list, as described in #455. The two commits are not really consecutive, but are instead alternatives.
The first commit removes simplejson via a breaking change, where the _update_records/upsert_records methods no longer have the ignore_nan parameter. This means when using these functions, it is on the user to make sure NaNs are not present in the records being uploaded, though the function does use json's allow_nan=False option to raise an error before making the destined-to-fail request to the server if NaN's are present. Handling of NaNs is present in the upsert_from_dataframe function, since this is the primary case where such behavior is desired. This is done in the same was as in tamr_client and both does not depend on simplejson and is robust.
The second commit also removes simplejson, but leaves the ignore_nan parameter in _update_records/upsert_records. This parameter is removed from the upsert_from_dataframe and create_from_dataframe functions, since these are changed to use the tamr_client DataFrame solution. The custom implementation of ignore_nan for _update_records/upsert_records is simple, but limited. While serializing JSON of each update, allow_nan=False is used and raised errors are handled by looking for Python NaN values at the top-level within a record. This means that the breaking change is limited to the last of the following example updates:
↪️ Pull Request
Relates to #455
This PR explores two ways that
simplejson
could be removed from the dependency list, as described in #455. The two commits are not really consecutive, but are instead alternatives.The first commit removes
simplejson
via a breaking change, where the_update_records
/upsert_records
methods no longer have theignore_nan
parameter. This means when using these functions, it is on the user to make sureNaN
s are not present in the records being uploaded, though the function does usejson
'sallow_nan=False
option to raise an error before making the destined-to-fail request to the server ifNaN
's are present. Handling ofNaN
s is present in theupsert_from_dataframe
function, since this is the primary case where such behavior is desired. This is done in the same was as intamr_client
and both does not depend onsimplejson
and is robust.The second commit also removes
simplejson
, but leaves theignore_nan
parameter in_update_records
/upsert_records
. This parameter is removed from theupsert_from_dataframe
andcreate_from_dataframe
functions, since these are changed to use thetamr_client
DataFrame solution. The custom implementation ofignore_nan
for_update_records
/upsert_records
is simple, but limited. While serializing JSON of each update,allow_nan=False
is used and raised errors are handled by looking for PythonNaN
values at the top-level within a record. This means that the breaking change is limited to the last of the following example updates:✔️ PR Todo
-dev
version:[#<issue number>](<link to issue>) <change description>