Skip to content

Conversation

yao-yh
Copy link

@yao-yh yao-yh commented Sep 18, 2025

  • 新增GetDataOptions接口,支持reference属性
  • 当reference为false时返回深拷贝数据
  • 保持向后兼容性

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Enhancement (changes that improvement of current feature or performance)
  • Refactoring (changes that neither fixes a bug nor adds a feature)
  • Test Case (changes that add missing tests or correct existing tests)
  • Code style optimization (changes that do not affect the meaning of the code)
  • Docs (changes that only update documentation)
  • Chore (changes that don't modify src or test files)

Self Check before Merge

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

- 新增GetDataOptions接口,支持reference属性
- 当reference为false时返回深拷贝数据
- 保持向后兼容性
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.

Summary of Changes

Hello @yao-yh, 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!

此拉取请求通过引入 GetDataOptions 接口增强了 Cell 类的 getData 方法。现在,调用者可以通过 reference 选项控制 getData 返回的是原始数据的引用还是深拷贝。这为数据检索提供了更大的灵活性,并有助于防止对原始数据意外的修改,同时确保了现有功能的向后兼容性。

Highlights

  • 新增GetDataOptions接口: 为 getData 方法引入了 GetDataOptions 接口,支持 reference 属性。
  • 深拷贝数据返回: 当 reference 属性设置为 false 时,getData 方法将返回数据的深拷贝,而非原始引用。
  • 向后兼容性: 保持了 getData 方法的向后兼容性,默认行为(返回引用)不变。
  • 单元测试: 为 getData 方法的新 reference 选项添加了单元测试,确保其行为符合预期。
  • 文档更新: 更新了中英文文档,详细说明了 getData 方法的新参数和行为。
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

这个 PR 引入了 getDatareference 选项,允许调用者选择获取数据的引用还是深拷贝,这是一个很好的功能增强。实现方式清晰,并且保持了向后兼容性。文档和测试也相应地更新了。

我提出了一些关于测试代码可读性和文档清晰度的建议,希望能让代码库更加完善。

@yao-yh yao-yh force-pushed the feature/getdata-option branch from e60a535 to 11e6534 Compare September 19, 2025 05:42
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.23%. Comparing base (0df719e) to head (11e6534).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4786   +/-   ##
=======================================
  Coverage   82.23%   82.23%           
=======================================
  Files         328      328           
  Lines       37613    37617    +4     
  Branches     7584     7586    +2     
=======================================
+ Hits        30930    30934    +4     
  Misses       6659     6659           
  Partials       24       24           
Flag Coverage Δ
x6 82.23% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/model/cell.ts 78.35% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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