Create-tableau-dashboard-based-on-iasworld-tests - #1093
Conversation
|
I'm not sure this is exactly the structure you wanted. It doesn't create an individual view for each of the subqueries, but that also feels like a lot to mantain, document, etc.. For me a single view makes the most sense, but happy to reconfigure it based on your feedback. I also left out this section until we get a solid grasp on what we want
It also doesn't union all iasworld views since we are only testing a single one first. |
| FROM {{ source('spatial', 'neighborhood') }} | ||
| ), | ||
|
|
||
| pardat_seq AS ( |
There was a problem hiding this comment.
named like this due to sequential tests.
| ARRAY['adrno'], | ||
| ARRAY[CAST(pardat.adrno AS VARCHAR)] | ||
| ) AS additional_fields | ||
| FROM {{ source('iasworld', 'pardat') }} AS pardat |
There was a problem hiding this comment.
We can pull the from pardat into it's own object and remove this from each query as well
AND pardat.cur = 'Y'
AND pardat.deactivat IS NULL
There was a problem hiding this comment.
I just did this, I think it makes it easier to follow.
| pardat.parid, | ||
| CAST(NULL AS INTEGER) AS card, | ||
| CAST(NULL AS INTEGER) AS lline, | ||
| legdat.township_code, |
There was a problem hiding this comment.
We often only need the join for township code, which should be deriveable from class, but we are also getting some errors for tests based on this. Let me know if we want this join for each. We can also move it up to the CTE.
| LEFT JOIN distinct_town_nbhd | ||
| ON pardat.nbhd = distinct_town_nbhd.town_nbhd | ||
| WHERE distinct_town_nbhd.town_nbhd IS NULL | ||
| AND pardat.nbhd NOT LIKE '%999' |
| pardat.who, | ||
| pardat.wen, | ||
| MAP( | ||
| ARRAY['luc'], |
There was a problem hiding this comment.
We already select class as one of our base columns. Do we want it as additional too? This goes for class or township values.
| SELECT | ||
| 'iasworld_pardat_cur_in_accepted_values' AS test_name, | ||
| 'cur should be ''Y'' or ''D''' AS test_description, | ||
| CAST(NULL AS VARCHAR) AS test_category, |
There was a problem hiding this comment.
Not all of the tests have a value for meta.category
jeancochrane
left a comment
There was a problem hiding this comment.
Very nice start here! I think the fundamentals of this approach are correct, and the output looks good.
That being said, it feels to me like this implementation might end up requiring a lot of repetitive boilerplate that could become difficult to maintain, i.e. a separate subquery for each individual test that needs to select the same set of columns in the same exact way. I thought it might be interesting to factor out as much of the boilerplate as possible into a shared macro, and I ended up producing a follow-up PR implementing that approach (#1095). Take a look at that PR and let me know if you think it's prohibitively confusing; if the macro stuff is impossible to understand, I'm down to continue forward with the more boilerplate-heavy approach we have here, and only refactor to a macro approach if/when it becomes unwieldy.
I'll take a look through it tomorrow, but it seems like a more efficient system. |
* Sketch out alernate proposal for iasWorld test result view architecture * Second draft of iasWorld test result view proposal, using macro * Fix typo in name of pardat.nbhd test * Small edits to macro approach based on pre-review
This is the query that I have been using to test. It seems like it gets updated pretty frequently, so although it passessed yesterday, it is failing today. Here's an example of a PIN which fails in this query, but has updated info for matching class_equals_luc: Parid
25343080220000I'm not sure this is exactly the structure you wanted. It doesn't create an individual view for each of the subqueries, but that also feels like a lot to mantain, document, etc.. For me a single view makes the most sense, but happy to reconfigure it based on your feedback.
I also left out this section until we get a solid grasp on what we want
It also doesn't union all iasworld views since we are only testing a single one first.