Skip to content

Update CDC500_states query - #2149

Open
shvngisingh wants to merge 2 commits into
datacommonsorg:masterfrom
shvngisingh:cdc500_states_query
Open

Update CDC500_states query#2149
shvngisingh wants to merge 2 commits into
datacommonsorg:masterfrom
shvngisingh:cdc500_states_query

Conversation

@shvngisingh

Copy link
Copy Markdown
Contributor

PR is for updating query in process.py from using the old resolved StatVarObservation table to the new TimeSeries and Observation schemas tables of latest spanner .

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the SQL query in scripts/us_cdc/cdc500_state/process.py by introducing Common Table Expressions (CTEs) and updating the source table references to spanner_dc_graph_prod_DEFAULT. The review identifies an opportunity to improve query performance by removing a redundant join in the svo_count CTE and recommends using SAFE_DIVIDE to handle potential division-by-zero errors during the percentage calculation.

Comment thread scripts/us_cdc/cdc500_state/process.py
Comment thread scripts/us_cdc/cdc500_state/process.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

1 participant