Skip to content

[Don't review] Test PR for golden checks#6096

Closed
SandeepTuniki wants to merge 23 commits intomasterfrom
migrate-place-info-v2-golden-updates
Closed

[Don't review] Test PR for golden checks#6096
SandeepTuniki wants to merge 23 commits intomasterfrom
migrate-place-info-v2-golden-updates

Conversation

@SandeepTuniki
Copy link

No description provided.

@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 primarily focuses on updating internal test data and migrating Data Commons API calls from V1 to V2 within the datacommons.py service. The changes ensure that the system is compatible with the newer API version and that existing test configurations reflect the latest data and naming conventions, particularly for geographical entities and statistical observations.

Highlights

  • Data Commons API Migration: The get_place_info and get_series_dates functions in server/services/datacommons.py were refactored to utilize the Data Commons V2 API. This includes a new BFS-based approach for retrieving place ancestors and a ranking system for determining the most relevant place type.
  • New Test File for API Migration: A new test file, server/tests/migration_verification_test.py, was added to verify the correct functionality of the migrated get_place_info and get_series_dates functions, including handling of recursion limits and cyclic dependencies.
  • Configuration File Updates: Several JSON configuration files within server/integration_tests/test_data/ were updated. These changes include adjusting place types (e.g., 'City' to 'AdministrativeArea2'), refining float precision, updating place names from 'New York' to 'New York City', and adding new ranking tiles for population data in Mexico City.
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.

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 primarily focuses on migrating get_place_info and get_series_dates functions in server/services/datacommons.py from using V1 API endpoints to V2. This involves substantial new logic to replicate the previous functionality, including a BFS-based ancestor traversal. Commendably, comprehensive unit tests have been added to validate the new implementations, covering basic functionality as well as edge cases like recursion depth limits and cyclical data. The PR also includes updates to various test data files to align with the new logic and improve data quality. My review includes suggestions to improve code maintainability by extracting duplicated logic and replacing a magic number with a constant. I also noted a potential data duplication issue in one of the test files.

Comment on lines +509 to +515
{
"dcid": "wikidataId/Q953866",
"name": "Tlalpan",
"types": [
"AdministrativeArea2"
]
},
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 appears to be a duplicate entry for "Tlalpan" in the childPlaces list (the other is on lines 453-459). Although the dcids are different (wikidataId/Q408187 and wikidataId/Q953866), they both refer to the same place. If this is not intentional for testing, consider removing one to prevent potential issues with duplicate data.

@SandeepTuniki
Copy link
Author

Closing this PR as all changes are ported over to the main PR #6047

@SandeepTuniki SandeepTuniki deleted the migrate-place-info-v2-golden-updates branch March 18, 2026 09:43
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