vizabi / core

Data fetching and transformation module with API based on Grammar of Graphics
1 stars 1 forks source link

Feature: "join where clause" in query (filter UN states) #31

Closed angiehjort closed 3 years ago

angiehjort commented 3 years ago
data: {
          locale: "en",
          source: "sg",
          space: ["country", "time"],
          filter: {
            dimensions: {
              "country": {"un_state": true}
            }
          }
        },

this results in a query

https://big-waffle.gapminder.org/SG-develop/97eaa4d?_language=en&select_key@=country&=time;&value@=income/_per/_person/_gdppercapita/_ppp/_inflation/_adjusted&=population/_total&=gapminder/_gini;;&from=datapoints&where_un/_state:true

which errors Unknown concept 'SG-develop_geo$time_97eaa4d.un_state'

expected one with "where" joinery:

https://big-waffle.gapminder.org/sg-master/2ea2332?_language=en&select_key@=country&=time;&value@=gapminder/_gini;;&from=datapoints&where_$and@_country=$country;;;&join_$country_key=country&where_un/_state:true;;;&order/_by@=time

feature: "join where clause" in query is missing from vizabi reactive

jheeffer commented 3 years ago

Imperfect workaround:

data: {
  locale: "en",
  source: "sg",
  space: ["country", "time"],
  filter: {
    dimensions: {
      "country": { "country.un_state": true }
    }
  }
},

Shouldn't have to do this because we're already indicating it's a country join through dimension: { country: { ... } }. This works because filter gets put on datapoints query without join and then goes through dotToJoin query transform.

jheeffer commented 3 years ago

With this commit workaround stops working and expected notation as in issue-start works.