Skip to content

Commit

Permalink
Expand ObsCollection cache by allowing for State/City<-->CensusTract. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Spaceenter authored Jun 9, 2023
1 parent e4f5458 commit 2c3fd8d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/server/v2/observation/contained_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"context"
"log"
"sort"
"strings"

pb "github.com/datacommonsorg/mixer/internal/proto"
pbv2 "github.com/datacommonsorg/mixer/internal/proto/v2"
Expand Down Expand Up @@ -66,6 +67,14 @@ func hasCollectionCache(ancestor string, childType string) bool {
_, ok := childTypeAllowListForEarth[childType]
return ok
}

if strings.HasPrefix(ancestor, "geoId/") &&
(len(ancestor) == 8 /* US State DCID size */ ||
len(ancestor) == 13 /* US City DCID size */) &&
childType == "CensusTract" {
return true
}

_, ok := childTypeDenyList[childType]
return !ok
}
Expand Down

0 comments on commit 2c3fd8d

Please sign in to comment.