Skip to content

Conversation

@ChanukaUOJ
Copy link
Contributor

This PR closes: #53

  • This PR includes the API to retrieve all the available years for a dataset. What this endpoint does is, The Endpoint takes the categoryID(parentID) as the parameter and it checks all the IS_ATTRIBUTE relations for the given category and then takes the relation start time. then takes the year from the relation start times and send it as a list in the final response.
  • API calls are parallel to minimize the latency
  • Test cases were added to then the API in different ways

@ChanukaUOJ ChanukaUOJ self-assigned this Jan 13, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ChanukaUOJ, 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 introduces a significant new feature by providing an API endpoint that allows users to query the available years for datasets associated with a specific category. The implementation involves creating a dedicated data service responsible for orchestrating calls to the underlying OpenGIN service, enriching the retrieved data, and presenting it in a user-friendly format. The design prioritizes performance through parallel processing and includes thorough testing to cover various scenarios and edge cases.

Highlights

  • New API Endpoint: Implemented a new API endpoint /v1/data/categories/{category_id}/datasets/years to retrieve all available years for a given dataset category.
  • Data Service Introduction: A new DataService has been added to handle data catalog and dataset year fetching logic, including enrichment of dataset and category information.
  • Parallel API Calls: The new endpoint leverages parallel API calls to OpenGINService to minimize latency when fetching related data.
  • Pydantic Model Enhancements: New Pydantic models (Label, Category, Dataset) were introduced to better represent data structures within the application.
  • Comprehensive Testing: Extensive unit tests have been added for the new DataService and updated for existing services to ensure robustness and correctness of the new features and changes.
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 introduces a new endpoint to retrieve all available years for a dataset, which is a valuable addition. The implementation correctly uses asyncio to perform API calls in parallel, minimizing latency, and is well-supported by a comprehensive set of new test cases. My feedback focuses on opportunities to enhance code clarity, maintainability, and robustness. Specifically, I've suggested simplifying some asyncio patterns, improving dependency injection for services, replacing magic strings with constants, and ensuring unused imports are removed from test files. Overall, this is a solid contribution that adds important functionality.

@ChanukaUOJ
Copy link
Contributor Author

/gemini review

1 similar comment
@ChanukaUOJ
Copy link
Contributor Author

/gemini review

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 introduces a new endpoint to fetch available years for a set of datasets. The implementation correctly uses asyncio for parallel fetching of dataset entities, and is well-covered by unit tests.

My review includes a few suggestions for improvement:

  • A critical fix to prevent an IndexError when a dataset's parent category cannot be found.
  • A high-priority change to correctly handle NotFoundError from downstream services, ensuring the API returns a 404 instead of a 500 error.
  • Some medium-severity suggestions to improve code clarity and documentation.

Overall, this is a good contribution. Addressing these points will make the implementation more robust and maintainable.

@ChanukaUOJ ChanukaUOJ requested a review from zaeema-n January 22, 2026 10:17
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.

Endpoint implementation for get all available years for a dataset

1 participant