Skip to content

Create view from cmap data EI issue#1022

Merged
wrridgeway merged 14 commits intomasterfrom
1021-create-view-from-cmap-data-issue
Apr 28, 2026
Merged

Create view from cmap data EI issue#1022
wrridgeway merged 14 commits intomasterfrom
1021-create-view-from-cmap-data-issue

Conversation

@wrridgeway
Copy link
Copy Markdown
Member

@wrridgeway wrridgeway commented Apr 27, 2026

This view should make a yearly export to cmap more manageable. It is essentially the same as the query from this EI issue. I created a new export schema for this since it didn't seem to fit well into anything we already have, but I'm happy to move it elsewhere if we're not into it.

@wrridgeway wrridgeway self-assigned this Apr 27, 2026
@wrridgeway wrridgeway linked an issue Apr 27, 2026 that may be closed by this pull request
Comment thread dbt/models/external/schema/external.vw_cmap.yml Outdated
Comment on lines +140 to +146
-- Combined municipality name is an array. Empty arrays indicate
-- unincorporated parcels. Null values indicate missing data.
CASE
WHEN CARDINALITY(vpu.combined_municipality_name) = 0
THEN 'UNINCORPORATED'
ELSE ARRAY_JOIN(vpu.combined_municipality_name, ', ')
END AS municipality,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated from the EI issue.

@wrridgeway wrridgeway requested a review from ccao-jardine April 27, 2026 20:19
@wrridgeway wrridgeway marked this pull request as ready for review April 27, 2026 20:19
@wrridgeway wrridgeway requested a review from a team as a code owner April 27, 2026 20:19
@wrridgeway wrridgeway changed the title Create view from cmap data ei issue Create view from cmap data EI issue Apr 27, 2026
Comment on lines +24 to +25
- name: class_description
description: 'A short description of the class code'
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could move this to a shared column description if we feel the need, but the only other place I saw a column like this was in pinval and I'm not sure if that column is exactly the same as what we have here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Thought, non-blocking] Yeah, the HomeVal class description is slightly different. It seems like this column is just coming directly from the ccao.class_dict seed though, so potentially those two columns could share docs? But since we're not currently documenting the columns on ccao.class_dict, I don't feel strongly about it.

Copy link
Copy Markdown
Member

@jeancochrane jeancochrane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only took a quick skim of the query since it was already reviewed, but overall it looks good to me! This is a very cool view that aggregates a lot of disparate tables and I bet other folks outside CMAP would be interested it. I assume you and @ccao-jardine have talked about this already, but it would be interesting to think about what this could look like as an open data asset, which would also remove the need for scheduling and completing a yearly export.

Regarding the schema name: We could also consider external, which I think would be slightly more descriptive than export. But ultimately I'm fine with either.

Comment on lines +24 to +25
- name: class_description
description: 'A short description of the class code'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Thought, non-blocking] Yeah, the HomeVal class description is slightly different. It seems like this column is just coming directly from the ccao.class_dict seed though, so potentially those two columns could share docs? But since we're not currently documenting the columns on ccao.class_dict, I don't feel strongly about it.

Comment thread dbt/models/export/schema/export.vw_cmap.yml Outdated
Comment thread dbt/models/export/schema/export.vw_cmap.yml Outdated
Comment thread dbt/models/export/export.vw_cmap.sql Outdated
Comment thread dbt/models/export/export.vw_cmap.sql Outdated
AND procname = 'BORVALUE'
AND valclass IS NULL -- Class 999 are test pins
AND class NOT IN ('999')
AND taxyr IN ('2023', '2024')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Question, non-blocking] What's our plan for updating this in subsequent years? Do we just plan to put up a PR every year incrementing these year values? I could also add it to my draft list of yearly update chores, if we want to institutionalize it.

Copy link
Copy Markdown
Member Author

@wrridgeway wrridgeway Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh gosh, i think i should just remove these years. i dont' think there's any reason someone can't just add their own where clause when pulling the data.

Comment on lines +80 to +82
CASE WHEN char_frpl = 1 THEN 'Full'
WHEN char_frpl = 2 THEN 'Partial'
WHEN char_frpl = 3 THEN 'None'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Thought, non-blocking] No action now, but it would be really cool if we could centralize this kind of SQL char conersion logic in the same way we do for R/Python code in the ccao package. Something to think about for a future improvement.

wrridgeway and others added 7 commits April 28, 2026 09:14
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
@wrridgeway wrridgeway merged commit 70620e5 into master Apr 28, 2026
8 checks passed
@wrridgeway wrridgeway deleted the 1021-create-view-from-cmap-data-issue branch April 28, 2026 14:32
@ccao-jardine
Copy link
Copy Markdown
Member

I only took a quick skim of the query since it was already reviewed, but overall it looks good to me! This is a very cool view that aggregates a lot of disparate tables and I bet other folks outside CMAP would be interested it. I assume you and @ccao-jardine have talked about this already, but it would be interesting to think about what this could look like as an open data asset, which would also remove the need for scheduling and completing a yearly export.

Regarding the schema name: We could also consider external, which I think would be slightly more descriptive than export. But ultimately I'm fine with either.

Re: potential Open Data Asset, agreed, @jeancochrane, I think this has strong potential! We didn't go for it quite yet because of the nuance of working with this bespoke data model. Rows are distinct to PIN and card (and year), but we provide PIN AVs -- such that if a PIN has two cards, the AV is duped in two rows. Users without CMAP-level knowledge could draw the wrong conclusions by, for example, summing up all AVs of all rows, rather than summing AVs per distinct PIN.

But I'm open to being convinced 😎

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.

Create view from CMAP data issue

3 participants