Skip to content

updated python client#79

Merged
pranjal-astuto merged 1 commit into
mainfrom
pu/update-python-client-2026-01-19
Jan 19, 2026
Merged

updated python client#79
pranjal-astuto merged 1 commit into
mainfrom
pu/update-python-client-2026-01-19

Conversation

@pranjal-astuto
Copy link
Copy Markdown
Contributor

No description provided.

@pranjal-astuto pranjal-astuto merged commit a93a010 into main Jan 19, 2026
0 of 10 checks passed
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @pranjal-astuto, 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 significantly updates the Python client by integrating new functionalities across several domains. It expands the client's capabilities to manage aggregated tickets, providing a mechanism for their deletion. Furthermore, it introduces robust features for Kubernetes workload analysis, enabling the retrieval of detailed spot migration statistics and risk assessments. Finally, the client now supports unsyncing ticket data, offering more granular control over data synchronization. These enhancements aim to provide a more comprehensive and up-to-date interface for interacting with the backend services.

Highlights

  • Aggregated Ticket Management: Introduced new models and an API endpoint for deleting aggregated tickets, enhancing control over ticket lifecycles.
  • Kubernetes Workload Spot Migration Assessment: Added comprehensive models and API endpoints to retrieve detailed statistics and individual workload data with spot migration risk assessments. This includes risk levels, workload counts, costs, and potential savings.
  • Ticket Data Unsync Functionality: Implemented new models and an API endpoint for unsyncing ticket data based on provided ticket and policy IDs.
  • Client Model Updates: Updated auto-generated timestamps and default UUIDs within the client models, reflecting recent generation events.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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
Copy Markdown

@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 updates the Python client with several new models and RPC handlers, likely from a regeneration process. The changes are mostly adding new endpoints and their corresponding data structures. My review focuses on improving code consistency and maintainability by addressing a type inconsistency and some code duplication in the new models, as well as a naming convention issue in one of the new RPC methods.

description="Type of the workload (e.g., Deployment, StatefulSet)",
title="Workload Type",
)
cluster_id: str = Field(..., description="ID of the cluster", title="Cluster Id")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The type of cluster_id is str, but in other models like GetSpotMigrationStatsRequest (line 2948), it is defined as UUID. For consistency across the models, it's recommended to use UUID for cluster_id here as well.

    cluster_id: UUID = Field(..., description="ID of the cluster", title="Cluster Id")

Comment on lines +2947 to +2951
class GetSpotMigrationStatsRequest(BaseModel):
cluster_id: UUID = Field(
..., description="ID of the cluster to get stats for", title="Cluster Id"
)
tenant_id: UUID = Field(..., description="ID of the tenant", title="Tenant Id")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The GetSpotMigrationStatsRequest model duplicates the cluster_id field from GetSpotMigrationStatsAPIRequest. To improve maintainability and reduce code duplication, you could have GetSpotMigrationStatsRequest inherit from GetSpotMigrationStatsAPIRequest.

class GetSpotMigrationStatsRequest(GetSpotMigrationStatsAPIRequest):
    tenant_id: UUID = Field(..., description="ID of the tenant", title="Tenant Id")

Comment on lines +17769 to +17781
class GetWorkloadsV3Request(BaseModel):
filters: Optional[
List[OnelensDomainUtilitiesRepositoriesDynamicFiltersFilterCriteria]
] = Field(
None,
description="Filters to apply (supports namespace, workload_name, workload_type, cluster_id)",
title="Filters",
)
order: Optional[SortCriteria] = Field(None, description="Sorting criteria")
pagination: Optional[PaginationParams] = Field(
None, description="Pagination parameters for the request"
)
tenant_id: UUID = Field(..., description="ID of the tenant", title="Tenant Id")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The GetWorkloadsV3Request model duplicates all fields from GetWorkloadsV3APIRequest. To improve maintainability and reduce code duplication, you could have GetWorkloadsV3Request inherit from GetWorkloadsV3APIRequest.

class GetWorkloadsV3Request(GetWorkloadsV3APIRequest):
    tenant_id: UUID = Field(..., description="ID of the tenant", title="Tenant Id")

)

@validate_call
def get_workloadsV3(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The method name get_workloadsV3 does not follow the PEP 8 style guide for function names, which recommends snake_case. For consistency and better readability, it should be renamed to get_workloads_v3. This change should also be applied to the helper method _get_workloadsV3_serialize and its usage.

Suggested change
def get_workloadsV3(
def get_workloads_v3(
References
  1. Function names should be lowercase, with words separated by underscores as necessary to improve readability. This is also known as snake_case. (link)

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