move-coop / parsons

A python library of connectors for the progressive community.
https://www.parsonsproject.org/
Other
258 stars 128 forks source link

Enable passing `identifiers` to ActionNetwork `upsert_person()` #861

Closed austinweisgrau closed 1 year ago

austinweisgrau commented 1 year ago

identifiers is a useful method when upserting a person, for either matching to an existing contact or creating a new contact.

The **kwargs keyword arguments on upsert_person() are passed as custom fields and so excludes the ability to add identifiers as additional keyword arguments without adding this functionality.

Small code readability improvements are also made to the get_tags() method in this PR by removing code that didn't do anything.

austinweisgrau commented 1 year ago

Hi Austin! We've reviewed this as part of our group pairing session. If you can address the comments other made, that would be great.

I'm also not sure how passing identifiers changes the response (if at all) and whether it's the sort of change that might need to be tested. Can you provide a bit more explanation of what this change does? Thank you!

Yeah definitely! After a more careful read of the docs, it looks like these cannot be used to match with existing contacts in ActionNetwork. Matching works exclusively on email and cell.

When creating or updating a person, any provided identifiers will be included on the contact record in ActionNetwork.

These must be globally unique in ActionNetwork, so if an identifier is provided that is already associated with a different ActionNetwork contact, ... I will test this and report back.

austinweisgrau commented 1 year ago

If the identifier provided is not globally unique in ActionNetwork, it will simply be ignored and not added to the object.

shaunagm commented 1 year ago

Yeah definitely! After a more careful read of the docs, it looks like these cannot be used to match with existing contacts in ActionNetwork. Matching works exclusively on email and cell.

When creating or updating a person, any provided identifiers will be included on the contact record in ActionNetwork.

These must be globally unique in ActionNetwork, so if an identifier is provided that is already associated with a different ActionNetwork contact, ... I will test this and report back.

If the identifier provided is not globally unique in ActionNetwork, it will simply be ignored and not added to the object.

If you can summarize this and add it to the docstring in a concise way (or, if there is an ActionNetwork page/section that explains this clearly) so that users know how to make use of this new parameter, that would be great. Other than that I think this is ready to merge.

austinweisgrau commented 1 year ago

How's this? 2b597bb454a808bc6f36f1d35499c6e4e6bfd027