-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ensure application_type
is added to views as a text field
#3908
Conversation
Removed vultr server and associated DNS entries |
(ls.allow_list_answers -> '_overrides'::text) AS overrides, | ||
(ls.allow_list_answers -> 'rab.exitReason'::text) AS rab_exit_reason, | ||
(ls.allow_list_answers -> 'service.type'::text) AS pre_app_service_type, | ||
(ls.allow_list_answers -> 'application.information.harmful'::text) AS pre_app_harmful_info, | ||
(ls.allow_list_answers -> 'application.information.sensitive'::text) AS pre_app_sensitive_info, | ||
(ls.allow_list_answers -> 'application.type' -> 0)::text AS application_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this one is different to all others?
Shouldn't this fix apply to all columns, or is the data captured differently here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure on the data in the other columns and the request was only for application.type
which I added the other week. My fear was thread pulling...
Given it was highlighted as a priority, thought it best to keep this PR small and load up another in future for the other fixes? @DafyddLlyr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the change up now, on second thought, seemed worth it to change and see what happens
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I get this now - it's always been array but we were never grabbing the actual value inside.
There's actually a number of columns that match this pattern - a single value in an array.
Maybe this is a question for @zz-hh-aa, but are we having issues with Metabase displaying any of the other values formatted as arrays?
Responding to @DafyddLlyr's point: the values display fine, it's just that Metabase won't let you filter on a JSONB value and we want councils to be able to filter on this one for the HHPP dashboard. With other JSONB columns, my other workaround has been creating a SQL query that does the reformatting, but we haven't needed to do it so often. The more graphs and councils we have and the more instances in which that fix needs to be made, the less sustainable it feels... I asked Mike ages ago about getting the other JSONB values recast as text to make them easier to handle in Metabase, and he explained why it was better to leave them as is--but I have to say I don't remember the rationale! |
I think the jsonb storage helps for data compression and size compared with text, maybe this was the reason? |
Let's try to revisit this one - if we can format this once when making the views then it's likely a win in a few places. |
I have added a new migration to add
application_type
to thesubmission_servies_summary
andanalytics_summary
views as a text field so Metabase can filter based on their values rather than their existence (currently you can only filter on whether the data exists or not, instead of what the data is)Main change is this line: