The Upper West Side’s historic Ansonia apartment building cannot evict a rent-stabilized tenant just because she was gone for six months or more in three consecutive years, a housing court judge has ruled, finding that her entire tenancy must be considered.

Judge Cheryl Gonzales (See Profile) denied the Ansonia’s motion for summary judgment against the tenant, Shelly Hall, on June 5, but did so without prejudice, leaving open the possibility for further discovery into Hall’s residence.

Gonzales had already denied the Ansonia summary judgment on April 15, but it moved to reargue, pointing to Hall’s passport, which it said showed that Hall had lived abroad for six months or more in 2009, 2010 and 2011, and her apartment in the Ansonia was not her primary residence.

Gonzales in Ansonia Associates v. Hall, 50122/13, said those absences were not enough to establish non-primary residence, both because Hall may still have spent half her time at the apartment during those years and because the known absences occurred in only three years out of a 35-year tenancy.

“In a non-primary residence proceeding the entire history of the tenancy is relevant,” she wrote.

The Ansonia is represented by Fran Jacobs, a partner at Duane Morris.

Hall is represented by Clinton Guthrie, assistant director at the SRO Law Project of the Goddard Riverside Community Center.