Medya Gh Medya Gh - 1 year ago 65
Python Question

An alternative to the `set()` function to retrieve a set of unique email?

I have a python script used to send email to people,
but don't want to email people more than once. I currently use a Python

to retrieve unique email addresses, but I want my solution to be scalable and persistent.

I have something like (30K) email addresses, and I am interested to know if this is doable easily in Google-datastore? Would that be an expensive operation ?

Answer Source

Starting from GAE 1.7.4, GQL supports SELECT DISTINCT ... queries so you could use that to get back the set of ... well ... distinct email address for your customers.

Please note that modern (how much modern?) versions of GQL have support for the GROUP BY clause too, if that suits your needs best.