From my cursory testing it seems that this returns the expected result. I was never able to get the original query to finish, so I can't be certain that it's returning the exact same result. The number of rows returned by the two queries seems to make sense and looking at the run IDs returned by each seem to make sense.
Looks pretty good! We have a bunch of unit tests in openaddr.tests.ci.test_read_completed_runs_to_date*; it might be worth reviewing those in case they don’t cover a complete set of cases.
These queries were causing the dotmap to never finish (https://github.com/openaddresses/openaddresses.io/issues/77#issuecomment-540818005), so I tried to make them simpler while doing the same thing.
From my cursory testing it seems that this returns the expected result. I was never able to get the original query to finish, so I can't be certain that it's returning the exact same result. The number of rows returned by the two queries seems to make sense and looking at the run IDs returned by each seem to make sense.