Adds mapping fields capability#931
Conversation
- Added `MiniExcelAttributeBase` abstract class and made the other attributes inherit it - Added feature for public fields of a class to be mapped alongside its properties if decorated with one of the attributes inheriting from afermonetioned base attribute - Renamed all mapping utilities to reflect their mapping functionality and the custom accessors to reflect the shift from only properties to members - Moved the `GetEmptyExpandoObject` methods to dedicated new class `ExpandoHelper`
Refactored `OpenXmlImporter` and `CsvImporter` removing redundant logic and moving duplicate method in shared extension helper
Summary of ChangesHello, 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 MiniExcel library by introducing the capability to map public fields of a class during Excel import and export operations. Previously, only properties were supported, but now, by decorating public fields with Highlights
🧠 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. Changelog
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a great new feature by adding support for mapping public fields, which increases the flexibility of the library. The extensive refactoring to centralize mapping logic, rename classes for clarity (e.g., MiniExcelColumnInfo to MiniExcelColumnMapping), and introduce a base attribute class are all excellent improvements for maintainability.
However, I've found a few issues in the new mapping logic that could lead to incorrect behavior or confusing error messages. My review includes suggestions to fix these bugs. Please take a look at the detailed comments.
Resolves #273 by adding the capability of mapping public fields of a class when importing or exporting an Excel file, by decorating them with
MiniExcelColumnAttributeor any of the other MiniExcel attributes. To do this it was necessary to refactor the mapping utilities to include such fields, and I took this as an opportunity to also restructure and clean up other parts of the library, like attributes, exceptions and some extensions.