WN 0002: Parameters in Malloy #1409
Replies: 9 comments 11 replies
-
+1 for support for Abstract views, etc. This use case especially I find myself hitting a lot while writing Malloy https://github.com/malloydata/whatsnext/blob/main/wns/WN-0002/wn-0002.md#abstract-views-let-us-build-reusable-query-shapes Typically in a model, I will land on an interesting view and then want to look at that same view shape, but with different dimensions, measures, or some other parameter. Right now the only solution is to copy/paste and manually change values. |
Beta Was this translation helpful? Give feedback.
-
Here's the argument against looker string filters. Malloy already has a facility for writing expressions which apply a series of tests to a value, it is wrong to re-invent something that exists. A abstract thingy which takes a filter should be taking a
If we decide we want looker filters, first we need to make them work inthe language ... again just making up syntax
Then looker filters would also work in
|
Beta Was this translation helpful? Give feedback.
-
This would be a great add-on and would simplify lots of unclear workarounds. In particular, I am using now a virtual source to define a reference date that I inner join with other sources filter them wrt that reference date. Being able to use a globally defined parameter would make it more clear to read and simple to implement. |
Beta Was this translation helpful? Give feedback.
-
I created a new WN 0014 for an MVP version of parameters: https://github.com/malloydata/whatsnext/blob/main/wns/WN-0014-mvp-parameters/WN-0014.md |
Beta Was this translation helpful? Give feedback.
-
Thread for how we handle "Preview" lens on sources with parameters(and also views on sources with parameters, and eventually views with their own parameters) We almost certainly need to re-work the lenses to specify source name to preview (and for views, source name and view name), rather then simply code to run. A couple options I can think of:
I personally think I prefer the "use custom elements" version. What do others think? |
Beta Was this translation helpful? Give feedback.
-
Thread for how we handle parameters in Composer?This could work a number of different ways. One idea is that all source parameters show up as widgets in the result panel (similar to the "use custom elements" idea for VSCode). When we have view/query parameters, you could also add parameters to your query (and then they would also be added as widgets to the result panel). When we have dimension/measure/view parameters, we can have an additional context bar that pops up asking you to fill in the parameters whenever you add something with parameters (if you had added parameters to the query, you could use those parameters as the value for dimension/measure/view parameters included in the query). |
Beta Was this translation helpful? Give feedback.
-
Thread for "Extending Parameterized Sources is Cumbersome"For sources with even a small number of parameters, extension becomes pretty cumbersome:
This is a clear downside to parameterized sources behaving like functions, rather than parameters being a property of the source, e.g.:
This downside can be weighed against:
|
Beta Was this translation helpful? Give feedback.
-
There is a new proposal to add the ability to inherit the default value (as well as tags) from the base class when extending, with syntax like:
I.e., by not providing a type or default value in the definition, you opt in to using the type, default value, and tags from the base source definition. There is an additional idea to allow:
This would copy all parameters from the base source. I feel a bit less sure about this latter syntax, since it muddies the clarity a bit too much for my taste. My preference would be to add the first behavior to the experiment, and see if people feel the need for the second syntax. But I'm curious what others think. |
Beta Was this translation helpful? Give feedback.
-
Is it planned to have parameters on queries? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
See current Proposal at: https://github.com/malloydata/whatsnext/blob/main/wns/WN-0002/wn-0002.md
Beta Was this translation helpful? Give feedback.
All reactions