Skip to content

Conversation

@rohitkumarbhagat
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @rohitkumarbhagat, 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 focuses on a significant internal refactoring to modernize the Data Commons API interactions within various data processing scripts. By transitioning from an older client to a new wrapper and client, the codebase is updated to leverage current API capabilities and data structures. This change impacts how statistical observations and node properties are retrieved and processed, ensuring future compatibility and potentially improving the efficiency and reliability of data operations.

Highlights

  • API Client Migration: The pull request systematically migrates several Python scripts from using the deprecated datacommons v1 client to a new util.dc_api_wrapper and datacommons_client for interacting with the Data Commons API.
  • Statistical Variable Observation (SVO) Data Model Update: The processing logic for Statistical Variable Observations (SVOs) has been updated to align with the new API response format, which now includes orderedFacets and facets for richer metadata and structured observations.
  • Refactored API Calls: API calls for fetching node properties (e.g., geoJsonCoordinates, typeOf) and SVOs have been refactored across eurostat and us_epa scripts to utilize the new wrapper and client, ensuring compatibility and improved data handling.
  • Test Data and Logic Adjustment: Corresponding test cases and mock data structures have been updated to reflect the changes in the SVO data model and the new API interaction patterns.
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

This pull request effectively deprecates the v1 datacommons Python client in favor of a v2-based API wrapper across several data import scripts for Eurostat, US EPA, and US NCES datasets. The changes are comprehensive, updating API calls, data handling logic, and corresponding tests to align with the new V2 API response structures. The migration simplifies some parts of the code by using dedicated wrapper functions, while correctly handling increased complexity in other areas where the V2 API provides less server-side filtering than V1. Overall, this is a solid step towards modernizing the data import infrastructure.

@rohitkumarbhagat rohitkumarbhagat merged commit b5872a1 into datacommonsorg:master Jan 30, 2026
9 checks passed
@rohitkumarbhagat rohitkumarbhagat deleted the sg-deprecate-pyclient branch January 30, 2026 04:46
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