fixes to segment expectation

This commit is contained in:
John Krauss 2016-05-17 11:35:19 -04:00
parent 3983967920
commit ddf9e9f3cc

View File

@ -98,13 +98,13 @@ SELECT cdb_observatory.OBS_GetSegmentSnapshot(
cdb_observatory._TestPoint(),
'us.census.tiger.census_tract'
)::text =
'{"x10_segment":"Wealthy, urban without Kids","x55_segment":"Wealthy city commuters","us.census.acs.B01001001_quantile":"0.234783783783784","us.census.acs.B01001002_quantile":"0.422405405405405","us.census.acs.B01001026_quantile":"0.0987567567567568","us.census.acs.B01002001_quantile":"0.0715","us.census.acs.B03002003_quantile":"0.295310810810811","us.census.acs.B03002004_quantile":"0.407189189189189","us.census.acs.B03002006_quantile":"0.625608108108108","us.census.acs.B03002012_quantile":"0.795202702702703","us.census.acs.B05001006_quantile":"0.703797297297297","us.census.acs.B08006001_quantile":"0.59227027027027","us.census.acs.B08006002_quantile":"0.0180540540540541","us.census.acs.B08006008_quantile":"0.993756756756757","us.census.acs.B08006009_quantile":"0.728162162162162","us.census.acs.B08006011_quantile":"0.995972972972973","us.census.acs.B08006015_quantile":"0.929135135135135","us.census.acs.B08006017_quantile":"0.625432432432432","us.census.acs.B09001001_quantile":"0.0386081081081081","us.census.acs.B11001001_quantile":"0.157121621621622","us.census.acs.B14001001_quantile":"0.241878378378378","us.census.acs.B14001002_quantile":"0.173783783783784","us.census.acs.B14001005_quantile":"0.0380675675675676","us.census.acs.B14001006_quantile":"0.0308108108108108","us.census.acs.B14001007_quantile":"0.0486216216216216","us.census.acs.B14001008_quantile":"0.479743243243243","us.census.acs.B15003001_quantile":"0.297675675675676","us.census.acs.B15003017_quantile":"0.190351351351351","us.census.acs.B15003022_quantile":"0.802513513513514","us.census.acs.B15003023_quantile":"0.757148648648649","us.census.acs.B16001001_quantile":"0.255405405405405","us.census.acs.B16001002_quantile":"0.196094594594595","us.census.acs.B16001003_quantile":"0.816851351351351","us.census.acs.B17001001_quantile":"0.252513513513514","us.census.acs.B17001002_quantile":"0.560054054054054","us.census.acs.B19013001_quantile":"0.777472972972973","us.census.acs.B19083001_quantile":"0.336932432432432","us.census.acs.B19301001_quantile":"0.655378378378378","us.census.acs.B25001001_quantile":"0.141810810810811","us.census.acs.B25002003_quantile":"0.362824324324324","us.census.acs.B25004002_quantile":"0.463837837837838","us.census.acs.B25004004_quantile":"0","us.census.acs.B25058001_quantile":"0.939040540540541","us.census.acs.B25071001_quantile":"0.419445945945946","us.census.acs.B25075001_quantile":"0.0387972972972973","us.census.acs.B25075025_quantile":null}' as test_point_segmentation;
'{"x10_segment":"Wealthy, urban without Kids","x55_segment":"Wealthy transplants displacing long-term local residents","us.census.acs.B01003001_quantile":"0.3235","us.census.acs.B01001002_quantile":"0.494716216216216","us.census.acs.B01001026_quantile":"0.183756756756757","us.census.acs.B01002001_quantile":"0.0752837837837838","us.census.acs.B03002003_quantile":"0.293162162162162","us.census.acs.B03002004_quantile":"0.455527027027027","us.census.acs.B03002006_quantile":"0.656405405405405","us.census.acs.B03002012_quantile":"0.840081081081081","us.census.acs.B05001006_quantile":"0.727135135135135","us.census.acs.B08006001_quantile":"0.688635135135135","us.census.acs.B08006002_quantile":"0.0204459459459459","us.census.acs.B08006008_quantile":"0.679324324324324","us.census.acs.B08006009_quantile":"0.996716216216216","us.census.acs.B08006011_quantile":"0.967418918918919","us.census.acs.B08006015_quantile":"0.512945945945946","us.census.acs.B08006017_quantile":"0.0504864864864865","us.census.acs.B09001001_quantile":"0.192405405405405","us.census.acs.B11001001_quantile":"0.331702702702703","us.census.acs.B14001001_quantile":"0.296283783783784","us.census.acs.B14001002_quantile":"0.045472972972973","us.census.acs.B14001005_quantile":"0.0442702702702703","us.census.acs.B14001006_quantile":"0.0829054054054054","us.census.acs.B14001007_quantile":"0.701135135135135","us.census.acs.B14001008_quantile":"0.404527027027027","us.census.acs.B15003001_quantile":"0.191824324324324","us.census.acs.B15003017_quantile":"0.864162162162162","us.census.acs.B15003022_quantile":"0.754297297297297","us.census.acs.B15003023_quantile":"0.350054054054054","us.census.acs.B16001001_quantile":"0.217635135135135","us.census.acs.B16001002_quantile":"0.85972972972973","us.census.acs.B16001003_quantile":"0.342851351351351","us.census.acs.B17001001_quantile":"0.51204054054054","us.census.acs.B17001002_quantile":"0.813540540540541","us.census.acs.B19013001_quantile":"0.0948648648648649","us.census.acs.B19083001_quantile":"0.678351351351351","us.census.acs.B19301001_quantile":"0.146108108108108","us.census.acs.B25001001_quantile":"0.149067567567568","us.census.acs.B25002003_quantile":"0","us.census.acs.B25004002_quantile":"0","us.census.acs.B25004004_quantile":"0.944554054054054","us.census.acs.B25058001_quantile":"0.398040540540541","us.census.acs.B25071001_quantile":"0.0596081081081081","us.census.acs.B25075001_quantile":"0","us.census.acs.B25075025_quantile":null}u' as test_point_segmentation;
-- segmentation around null island
SELECT cdb_observatory.OBS_GetSegmentSnapshot(
ST_SetSRID(ST_Point(0, 0), 4326),
'us.census.tiger.census_tract'
)::text = '{"x10_segment":null,"x55_segment":null,"us.census.acs.B01001001_quantile":null,"us.census.acs.B01001002_quantile":null,"us.census.acs.B01001026_quantile":null,"us.census.acs.B01002001_quantile":null,"us.census.acs.B03002003_quantile":null,"us.census.acs.B03002004_quantile":null,"us.census.acs.B03002006_quantile":null,"us.census.acs.B03002012_quantile":null,"us.census.acs.B05001006_quantile":null,"us.census.acs.B08006001_quantile":null,"us.census.acs.B08006002_quantile":null,"us.census.acs.B08006008_quantile":null,"us.census.acs.B08006009_quantile":null,"us.census.acs.B08006011_quantile":null,"us.census.acs.B08006015_quantile":null,"us.census.acs.B08006017_quantile":null,"us.census.acs.B09001001_quantile":null,"us.census.acs.B11001001_quantile":null,"us.census.acs.B14001001_quantile":null,"us.census.acs.B14001002_quantile":null,"us.census.acs.B14001005_quantile":null,"us.census.acs.B14001006_quantile":null,"us.census.acs.B14001007_quantile":null,"us.census.acs.B14001008_quantile":null,"us.census.acs.B15003001_quantile":null,"us.census.acs.B15003017_quantile":null,"us.census.acs.B15003022_quantile":null,"us.census.acs.B15003023_quantile":null,"us.census.acs.B16001001_quantile":null,"us.census.acs.B16001002_quantile":null,"us.census.acs.B16001003_quantile":null,"us.census.acs.B17001001_quantile":null,"us.census.acs.B17001002_quantile":null,"us.census.acs.B19013001_quantile":null,"us.census.acs.B19083001_quantile":null,"us.census.acs.B19301001_quantile":null,"us.census.acs.B25001001_quantile":null,"us.census.acs.B25002003_quantile":null,"us.census.acs.B25004002_quantile":null,"us.census.acs.B25004004_quantile":null,"us.census.acs.B25058001_quantile":null,"us.census.acs.B25071001_quantile":null,"us.census.acs.B25075001_quantile":null,"us.census.acs.B25075025_quantile":null}' as null_island_segmentation;
)::text = '{"x10_segment":null,"x55_segment":null,"us.census.acs.B01003001_quantile":null,"us.census.acs.B01001002_quantile":null,"us.census.acs.B01001026_quantile":null,"us.census.acs.B01002001_quantile":null,"us.census.acs.B03002003_quantile":null,"us.census.acs.B03002004_quantile":null,"us.census.acs.B03002006_quantile":null,"us.census.acs.B03002012_quantile":null,"us.census.acs.B05001006_quantile":null,"us.census.acs.B08006001_quantile":null,"us.census.acs.B08006002_quantile":null,"us.census.acs.B08006008_quantile":null,"us.census.acs.B08006009_quantile":null,"us.census.acs.B08006011_quantile":null,"us.census.acs.B08006015_quantile":null,"us.census.acs.B08006017_quantile":null,"us.census.acs.B09001001_quantile":null,"us.census.acs.B11001001_quantile":null,"us.census.acs.B14001001_quantile":null,"us.census.acs.B14001002_quantile":null,"us.census.acs.B14001005_quantile":null,"us.census.acs.B14001006_quantile":null,"us.census.acs.B14001007_quantile":null,"us.census.acs.B14001008_quantile":null,"us.census.acs.B15003001_quantile":null,"us.census.acs.B15003017_quantile":null,"us.census.acs.B15003022_quantile":null,"us.census.acs.B15003023_quantile":null,"us.census.acs.B16001001_quantile":null,"us.census.acs.B16001002_quantile":null,"us.census.acs.B16001003_quantile":null,"us.census.acs.B17001001_quantile":null,"us.census.acs.B17001002_quantile":null,"us.census.acs.B19013001_quantile":null,"us.census.acs.B19083001_quantile":null,"us.census.acs.B19301001_quantile":null,"us.census.acs.B25001001_quantile":null,"us.census.acs.B25002003_quantile":null,"us.census.acs.B25004002_quantile":null,"us.census.acs.B25004004_quantile":null,"us.census.acs.B25058001_quantile":null,"us.census.acs.B25071001_quantile":null,"us.census.acs.B25075001_quantile":null,"us.census.acs.B25075025_quantile":null}' as null_island_segmentation;
WITH result as (
SELECT array_agg(_OBS_GetCategories) as expected FROM