Skip to content

Remove mailing names and address associated with suppresion requests from address view#1040

Merged
wrridgeway merged 5 commits into
masterfrom
hidenames
May 28, 2026
Merged

Remove mailing names and address associated with suppresion requests from address view#1040
wrridgeway merged 5 commits into
masterfrom
hidenames

Conversation

@wrridgeway
Copy link
Copy Markdown
Member

@wrridgeway wrridgeway commented May 27, 2026

This PR creates a new table ccao.hidename which is fed by a list of PINs stored on the O drive. Any PIN from this list will not have any data from iasworld.maildat surfaced in default.vw_pin_address.

select mail_address_name is null as "mailing address is null",
	count() as rows,
	'new' as source
from z_ci_hidenames_default.vw_pin_address
group by mail_address_name is null
union all
select mail_address_name is null as "mailing address is null",
	count() as rows,
	'old' as source
from default.vw_pin_address
group by mail_address_name is null
mailing_address_is_null rows source
false 48003634 old
true 2667468 old
true 2668055 new
false 48003047 new

the difference in null rows is 587, which is exactly what we expect:

select count()
from default.vw_pin_address vpa
	inner join ccao.hidename hide on vpa.pin = hide.pin

gives us 587.

with pins as (
	select pin
	from ccao.hidename
)
select vpa.*
from z_ci_hidenames_default.vw_pin_address as vpa
	inner join pins on vpa.pin = pins.pin
where mail_address_name is not null

returns no rows.

@wrridgeway wrridgeway marked this pull request as ready for review May 27, 2026 21:20
@wrridgeway wrridgeway requested a review from a team as a code owner May 27, 2026 21:20
@wrridgeway wrridgeway changed the title Hidenames Remove mailing names and address associated with suppresion requests from address view May 27, 2026
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.

Thanks for picking this up so quickly! I have one question about high-level behavior, but otherwise this looks fine to me.

Comment thread dbt/models/ccao/schema.yml
Comment on lines +10 to +27
mail.parid,
mail.taxyr,
{{ concat_address(['mail.mail1', 'mail.mail2']) }}
AS mail_address_name,
{{ concat_address(['mail.maddr1', 'mail.maddr2']) }}
AS mail_address_full,
mail.mcityname AS mail_address_city_name,
mail.mstatecode AS mail_address_state,
NULLIF(mail.mzip1, '00000') AS mail_address_zipcode_1,
NULLIF(mail.mzip2, '0000') AS mail_address_zipcode_2,
mail.mailseq = MAX(mail.mailseq)
OVER (PARTITION BY mail.parid, mail.taxyr) AS newest,
hide.pin AS hide_pin
FROM {{ source('iasworld', 'maildat') }} AS mail
LEFT JOIN {{ source('ccao', 'hidename') }} AS hide
ON mail.parid = hide.pin
WHERE mail.cur = 'Y'
AND mail.deactivat IS NULL
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] Just confirming that this behavior will remove the entire row for every year for every PIN in the source list. Is that the behavior we want @ccao-jardine? Or do we want to preserve the row and replace the non-PIN/year data with indicator values, or nulls?

Copy link
Copy Markdown
Member Author

@wrridgeway wrridgeway May 27, 2026

Choose a reason for hiding this comment

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

The PIN will still have a row in the view, just NULLs for columns from maildat. Could totally change the NULLs to a filler value.

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.

Oops, that's right, my bad! The current behavior seems like the best option to me, then.

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.

Thanks for this bandaid and thorough review! Confirming that I do want the PIN to have a row, replacing the contents of the MAILDAT columns with nulls.

wrridgeway and others added 2 commits May 27, 2026 16:34
Co-authored-by: Jean Cochrane <jeancochrane@users.noreply.github.com>
@wrridgeway wrridgeway merged commit 95e9b69 into master May 28, 2026
8 checks passed
@wrridgeway wrridgeway deleted the hidenames branch May 28, 2026 14:36
@wrridgeway wrridgeway linked an issue May 28, 2026 that may be closed by this pull request
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.

Hotfix for Public Act 104-0443

3 participants