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

Update QC report tags, code, and docs to split tri town close reports from non-tri towns #574

Merged

Conversation

jeancochrane
Copy link
Contributor

@jeancochrane jeancochrane commented Aug 21, 2024

I learned from Will today that a few of the town close QC reports are specific to non-tri towns, meaning that he doesn't generate them for tri towns. This PR tweaks our tags, code, and docs for town close QC reporting to reflect this fact and allow us to export either tri town close QC reports or non-tri town close QC reports.

I tested this change by running the two versions of town close reports and confirming that the script exported the correct reports for each kind. To export a tri town:

python3 scripts/export_models.py --selector select_qc_report_town_close_tri --where "township_code = '72' and taxyr = '2024'"

To export a non-tri town:

python3 scripts/export_models.py --selector select_qc_report_town_close_non_tri --where "township_code = '20' and taxyr = '2024'"

Comment on lines +728 to +736
python3 scripts/export_models.py --selector select_qc_report_town_close_tri --where "taxyr = '$TAXYR' and township_code = '$TOWNSHIP_CODE'"
```

The script will output the reports to the `dbt/export/output/` directory, and will print the
names of the reports that it exports during execution.
Use the `select_qc_report_town_close_non_tri` selector to output reports for
a **non-tri town**:

```
python3 scripts/export_models.py --selector select_qc_report_town_close_non_tri --where "taxyr = '$TAXYR' and township_code = '$TOWNSHIP_CODE'"
```
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This new selector interface feels slightly clunky to me: The selector names are quite long, and I feel like it would be more intuitive if the export_models script could just infer whether the township is a tri town or a non-tri town based on the taxyr and township code. However, making that change would require either tighter coupling between export_models and the town close reports, or (more likely) an additional script like export_town_close_report on top of export_models that could implement that coupling. It might make sense for us to move in that direction in the future, but for now I went with the most incremental possible change that would satisfy the requirement of splitting tri town close reports from non-tri town reports.

Copy link
Member

Choose a reason for hiding this comment

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

I think that makes sense! Can you add an issue linking to this comment so we don't forget about it? Could be a good jr project IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call! See #576.

dbt/scripts/export_models.py Show resolved Hide resolved
dbt/scripts/export_models.py Show resolved Hide resolved
@jeancochrane jeancochrane marked this pull request as ready for review August 21, 2024 21:39
@jeancochrane jeancochrane requested a review from a team as a code owner August 21, 2024 21:39
@jeancochrane jeancochrane requested a review from dfsnow August 21, 2024 21:40
Copy link
Member

@dfsnow dfsnow left a comment

Choose a reason for hiding this comment

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

Looks good!

dbt/README.md Outdated
Comment on lines 713 to 720
In general, we tag the models that comprise our town close QC reports using the
`qc_report_town_close` tag. Models with this tag will be included in all town
close QC reports. If a model should be included in town close reports for tri
towns but not for non-tri towns, we tag it instead with
`qc_report_town_close_tri`. Likewise, the `qc_report_town_close_non_tri` tag
marks models that should be included in town close reports for _non-tri_ towns.
In both cases, we filter the models for a specific township code (like "70")
and tax year during export.
Copy link
Member

Choose a reason for hiding this comment

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

suggestion (non-blocking): Could be helpful here to define (or link out to a definition for) tri-town vs non-tri town. It's a pretty jargony term.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I fleshed out this paragraph and added a link to the Townships doc in 2e6848c.

Comment on lines +728 to +736
python3 scripts/export_models.py --selector select_qc_report_town_close_tri --where "taxyr = '$TAXYR' and township_code = '$TOWNSHIP_CODE'"
```

The script will output the reports to the `dbt/export/output/` directory, and will print the
names of the reports that it exports during execution.
Use the `select_qc_report_town_close_non_tri` selector to output reports for
a **non-tri town**:

```
python3 scripts/export_models.py --selector select_qc_report_town_close_non_tri --where "taxyr = '$TAXYR' and township_code = '$TOWNSHIP_CODE'"
```
Copy link
Member

Choose a reason for hiding this comment

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

I think that makes sense! Can you add an issue linking to this comment so we don't forget about it? Could be a good jr project IMO.

@@ -891,23 +891,23 @@ models:
description: '{{ doc("view_vw_report_town_close_prior_year_card_code_5s") }}'
config:
tags:
- qc_report_town_close
- qc_report_town_close_non_tri
Copy link
Member

Choose a reason for hiding this comment

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

Perfectly good tagging schema already off the rails.

@jeancochrane jeancochrane merged commit 6ab015a into master Aug 22, 2024
8 checks passed
@jeancochrane jeancochrane deleted the jeancochrane/mark-some-qc-town-close-reports-as-non-tri branch August 22, 2024 15:12
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.

2 participants