Closed fbertsch closed 3 years ago
Oh I see now - I need to use square brackets around the filters dict:
import lkml
lkml.dump({"dimensions": [{"name": "active_this_week", "type": "yesno", "sql": "${TABLE}.atw"}], "measures": {"name": "active_this_week", "filters": [{"active_this_week": "yes"}]}})
results in
'dimension: active_this_week {\n type: yesno\n sql: ${TABLE}.atw ;;\n}\n\nmeasures: active_this_week {\n filters: [\n active_this_week: "yes",\n ]\n}'
Might be good to add a section to the docs about this.
@joshtemple if you're up for it, I'll put a PR in to update the docs and add some descriptions of how to use filters in the object representation.
Hey @fbertsch, thanks for highlighting. You're right, this isn't behavior that's immediately obvious and I'd be very grateful to accept a docs PR!
For example:
This results in:
I would expect:
The current version fails LookML validation.