Conversation
Add BindingFlags.NonPublic to property and field searches in getExpandableProperties and getExpandableFields so that F# records marked as internal (or types with assembly-visible members) are correctly expanded by Frame.ofRecords. The fix also: - Excludes explicit interface implementations (property names containing '.') - Excludes compiler-generated backing fields (CompilerGeneratedAttribute) - Excludes private members (only public or assembly-visible members included) - Uses p.GetGetMethod(nonPublic=true) to retrieve non-public property getters Co-authored-by: Copilot <[email protected]>
This was referenced Mar 8, 2026
…s-1ae45186cfa8430a
…s-1ae45186cfa8430a
…s-1ae45186cfa8430a
…s-1ae45186cfa8430a
dsyme
approved these changes
Mar 9, 2026
…s-1ae45186cfa8430a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated PR from Repo Assist.
Closes #562
Root Cause
Frame.ofRecords(and related record-expansion functions) uses reflection to discover properties and fields of record types. The search was limited toBindingFlags.Public, but F# compiles property accessors as assembly-visible (not strictly public) when the record type is markedinternal. As a result,GetProperties(Public)returned nothing forinternalrecords, silently producing an empty frame.Fix
In
src/Deedle/FrameUtils.fs,getExpandablePropertiesandgetExpandableFieldsnow includeBindingFlags.NonPublicin the reflection search, with targeted filters to avoid including unwanted implementation-detail members:., e.g.System.Runtime.CompilerServices.ITuple.Length) and private getters. Allows public or assembly-visible (internal) getters.CompilerGeneratedAttribute, e.g. F# record backing fields likeDay@) and private fields.p.GetGetMethod(nonPublic=true)is used to correctly retrieve non-public property getter methods.Test Status
src/Deedle/Deedle.fsprojbuilds successfully (0 errors)tests/Deedle.Tests/Deedle.Tests.fsprojbuilds successfully (0 errors)Can read sequence of internal recordsadded and verified manually.NET 5.0is required to run the test suite viadotnet fake build, but the CI environment has only .NET 8/9/10. This is a pre-existing infrastructure constraint.Trade-offs
This change makes
Frame.ofRecordswork withinternalF# records defined in the same or another assembly. There is no change in behaviour for fully public types (the added filter excludes the same implementation-detail members that were previously invisible due toPublic-only search).