Skip to content

Data release US CPI pvmap fix#1906

Open
HarishC727 wants to merge 4 commits intodatacommonsorg:masterfrom
HarishC727:data_release_uscpi
Open

Data release US CPI pvmap fix#1906
HarishC727 wants to merge 4 commits intodatacommonsorg:masterfrom
HarishC727:data_release_uscpi

Conversation

@HarishC727
Copy link
Contributor

@HarishC727 HarishC727 commented Mar 10, 2026

The deletions were happening as the places were in “” format and the pvmap only had half string and places were not getting picked during processing.
Example:
Source: “Detroit-Warren-Dearborn, MI”
Pvmap : Detroit-Warren-Dearborn

On debugging, the data from source was getting split after comma and the place was not getting resolved

I added the full place in pvmap and the issue is resolved.

@pulkeet-wq
Copy link
Contributor

@HarishC727 : Please add the description of the work done in this PR. Please ensure the changes you are doing are captured in README file as well

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical data ingestion problem for US CPI data, specifically concerning the accurate mapping of geographical place names. By enhancing the pvmap with comprehensive and correctly formatted entries, it ensures that regional and metropolitan area data, previously failing to resolve, can now be processed successfully, thereby improving the completeness and reliability of the imported dataset.

Highlights

  • Data Ingestion Fix: Resolved an issue where US CPI data for specific places was not being processed correctly due to mismatches between source data formatting (e.g., quoted strings like "Detroit-Warren-Dearborn, MI") and existing pvmap entries (e.g., Detroit-Warren-Dearborn).
  • PVMap Expansion: Expanded the us_cpi_pvmap.csv file to include full, correctly formatted place names, ensuring that the data source's place strings are accurately resolved during processing.
  • Metadata Adjustment: Commented out the places_resolved_csv entry in us_cpi_metadata.csv, indicating a change in how place resolution is handled or referenced.
Changelog
  • statvar_imports/us_bls/us_cpi/us_cpi_metadata.csv
    • Commented out the places_resolved_csv entry.
  • statvar_imports/us_bls/us_cpi/us_cpi_pvmap.csv
    • Commented out the 'Consumer Price Index' mapping.
    • Adjusted the 'Expenditure category' and 'Area' mappings.
    • Added numerous new place mappings for US regions and metropolitan areas, including both short and fully qualified (quoted) names, to improve data resolution.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Code Review

The pull request effectively addresses the issue of place resolution in the US CPI data by adding comprehensive place name mappings to us_cpi_pvmap.csv. This approach of including both quoted and unquoted versions of place names is a robust solution for handling variations in source data. The change in us_cpi_metadata.csv to comment out the places_resolved_csv reference indicates a shift in the place resolution strategy, which aligns with the changes in the pvmap. However, there are a couple of issues in the us_cpi_pvmap.csv that need attention: an incomplete entry for a place and an unnecessary empty line.

Detroit-Warren-Dearborn,observationAbout,geoId/C19820
"Detroit-Warren-Dearborn, MI",observationAbout,geoId/C19820
Chicago-Naperville-Elgin,observationAbout,geoId/C16980
"Chicago-Naperville-Elgin, IL-IN-WI",
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The entry for "Chicago-Naperville-Elgin, IL-IN-WI" appears to be incomplete. It is missing the observationAbout property and its corresponding value (e.g., a geoId). This will likely lead to parsing errors or incorrect data mapping during processing.

"Chicago-Naperville-Elgin, IL-IN-WI",observationAbout,geoId/C16980

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

West South Central(4),observationAbout,usc/WestSouthCentralDivision
Mountain(4),observationAbout,usc/MountainDivision
Pacific(4),observationAbout,usc/PacificDivision
,
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

There is an empty line (,) in the pvmap.csv file. While some CSV parsers might ignore this, it's generally best practice to avoid empty lines in data files unless they serve a specific, documented purpose, as they can sometimes lead to unexpected parsing behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@pulkeet-wq
Copy link
Contributor

LGTM

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