Skip to content
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

Merged
merged 6 commits into from
Nov 5, 2024

Conversation

RODO94
Copy link
Contributor

@RODO94 RODO94 commented Nov 4, 2024

I have added a new migration to add application_type to the submission_servies_summary and analytics_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:

   (al.allow_list_answers -> 'application.type' -> 0)::text AS application_type

Copy link

github-actions bot commented Nov 4, 2024

Removed vultr server and associated DNS entries

@RODO94 RODO94 marked this pull request as ready for review November 4, 2024 15:39
@RODO94 RODO94 requested a review from a team November 4, 2024 15:39
@RODO94 RODO94 marked this pull request as draft November 4, 2024 15:44
@RODO94 RODO94 marked this pull request as ready for review November 4, 2024 16:02
Comment on lines 85 to 90
(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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

@RODO94 RODO94 requested a review from DafyddLlyr November 5, 2024 09:21
Copy link
Contributor

@DafyddLlyr DafyddLlyr left a 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?

image

@zz-hh-aa
Copy link
Collaborator

zz-hh-aa commented Nov 5, 2024

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!

@RODO94
Copy link
Contributor Author

RODO94 commented Nov 5, 2024

I think the jsonb storage helps for data compression and size compared with text, maybe this was the reason?

@RODO94 RODO94 merged commit 15e3f49 into main Nov 5, 2024
12 checks passed
@RODO94 RODO94 deleted the rory/metab-change branch November 5, 2024 15:39
@DafyddLlyr
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants