Skip to content

Conversation

@joshuanapoli
Copy link
Member

Improve documentation to better show how pandas DataFrames can be provided and how to use the EAV tables.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @joshuanapoli, 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 enhances the documentation for the cvec Python SDK. It refines the client initialization process by clarifying how tenant IDs are handled and updates the description of metric data retrieval to better reflect the underlying data format while providing a clear example for integrating with Pandas DataFrames. The most substantial addition is the detailed documentation for interacting with EAV (Entity-Attribute-Value) tables, offering guidance on fetching tables and columns, and querying data using both high-level named queries and lower-level ID-based queries.

Highlights

  • Updated CVec Client Initialization: The documentation for the CVec client constructor has been updated to reflect that the tenant parameter is no longer directly provided, as the tenant ID is now automatically fetched from the host's /config endpoint.
  • Improved Metric Data Documentation: The description of metric data returns has been clarified, and a new section with a Python example has been added to demonstrate how to efficiently load metric data into Pandas DataFrames using the get_metric_arrow function.
  • Comprehensive EAV Table Documentation: Extensive documentation has been added for interacting with EAV (Entity-Attribute-Value) tables, including functions to retrieve EAV tables (get_eav_tables), fetch columns for a specific table (get_eav_columns), and query pivoted data using both human-readable names (select_from_eav) and direct IDs (select_from_eav_id), complete with usage examples.
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 improves the documentation by adding details about pandas DataFrame integration and the new EAV (Entity-Attribute-Value) functions. The changes are clear and add valuable information for users of the SDK. I've made a few suggestions to improve the clarity and completeness of the examples and API descriptions in the README.md file. Specifically, I've pointed out some inconsistencies in the documentation for get_metric_data, suggested completing the documentation for EAVTable attributes, and recommended adjustments to the code examples for select_from_eav and select_from_eav_id to make them less confusing.

### Metric Data

The main content for a metric is a set of points where the metric value changed. These are returned as a Pandas Dataframe with columns for name, time, value_double, value_string.
The main content for a metric is a set of points where the metric value changed. These are returned with columns for name, time, value_double, value_string.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While this change to be more generic about the return type is a good step, there are still inconsistencies in the documentation for get_metric_data. The example output immediately following this line, and the function description under the CVec Class section (line 234), both strongly imply a Pandas DataFrame is returned. However, the function actually returns a List[MetricDataPoint]. To avoid confusion, I recommend updating the other parts of the documentation to be consistent with the function's actual return type.

Comment on lines +281 to +285
- `id`: The table's UUID
- `tenant_id`: The tenant ID
- `name`: Human-readable table name
- `created_at`: When the table was created
- `updated_at`: When the table was last updated
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The documentation for the EAVTable object is incomplete. The EAVTable model in src/cvec/models/eav_table.py also includes other optional fields. For completeness, please consider adding the following fields to the list:

  • continuation_token
  • last_sync_at
  • total_rows_synced
  • last_etag

joshuanapoli and others added 2 commits December 8, 2025 18:40
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link

@truggles truggles left a comment

Choose a reason for hiding this comment

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

Is there a way to query where the 1,000 newest records that match your filters will be the 1,000 returned?

Overall this is super helpful. Thank you!

@joshuanapoli
Copy link
Member Author

Is there a way to query where the 1,000 newest records that match your filters will be the 1,000 returned?

Right now, there a consistent way to order by record age; the result is junk if you hit 1000. I might redesign the table looking to support "monthly" data views for ATEK, in which case we might take the time to see if we can store more metadata without degrading performance too much.

@truggles
Copy link

truggles commented Dec 9, 2025

LGTM, merge when ready. Thanks.

@joshuanapoli joshuanapoli changed the title Document pandas DataFrame integration and EAV functions [PD1-597] Document pandas DataFrame integration and EAV functions Dec 19, 2025
@joshuanapoli joshuanapoli merged commit fd07385 into main Dec 19, 2025
1 check passed
@joshuanapoli joshuanapoli deleted the jn/doc branch December 19, 2025 19:25
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.

3 participants