-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Converted Schema to a class #1167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
9e19963
Created a Schema class for eager schema.
a00091a
Merge
9e5dbe7
Merge remote-tracking branch 'upstream/master' into feature/new-schem…
901dba9
Fixing the build after another merge
b27d7c4
Another round of ISchema cleanup
b6573dd
Fixed some tests
031f0f3
Fixed someone's bug in LabelConvert
95daa3d
Merge remote-tracking branch 'upstream/master' into feature/new-schem…
2f8bfa8
PR comments
ebe3178
Merge branch 'feature/new-schema-clean' of github.com:Zruty0/machinel…
182c9be
Merge
fd9fb6f
PR comments
6ce1d0c
Merge remote-tracking branch 'upstream/master' into feature/new-schem…
ce144ed
Proper rename of classes
94c8e13
Merge remote-tracking branch 'upstream/master' into feature/new-schem…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Another round of ISchema cleanup
- Loading branch information
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,9 @@ | |
|
|
||
| namespace Microsoft.ML.Runtime.Data | ||
| { | ||
| #pragma warning disable CS0618 // Type or member is obsolete | ||
| public sealed class Schema : ISchema | ||
| #pragma warning restore CS0618 // Type or member is obsolete | ||
| { | ||
| private readonly Column[] _columns; | ||
| private readonly Dictionary<string, int> _nameMap; | ||
|
|
@@ -182,10 +184,12 @@ public Schema(IEnumerable<Column> columns) | |
|
|
||
| public IEnumerable<(int index, Column column)> GetColumns() => _nameMap.Values.Select(idx => (idx, _columns[idx])); | ||
|
|
||
| /// <summary> | ||
| /// Manufacture an instance of <see cref="Schema"/> out of any <see cref="ISchema"/>. | ||
| /// </summary> | ||
| #pragma warning disable CS0618 // Type or member is obsolete | ||
| /// <summary> | ||
| /// Manufacture an instance of <see cref="Schema"/> out of any <see cref="ISchema"/>. | ||
| /// </summary> | ||
|
||
| public static Schema Create(ISchema inputSchema) | ||
| #pragma warning restore CS0618 // Type or member is obsolete | ||
| { | ||
| Contracts.CheckValue(inputSchema, nameof(inputSchema)); | ||
|
|
||
|
|
@@ -207,7 +211,9 @@ public static Schema Create(ISchema inputSchema) | |
| return new Schema(columns); | ||
| } | ||
|
|
||
| #pragma warning disable CS0618 // Type or member is obsolete | ||
| private static Delegate GetMetadataGetterDelegate<TValue>(ISchema schema, int col, string kind) | ||
| #pragma warning restore CS0618 // Type or member is obsolete | ||
| { | ||
| // REVIEW: We are facing a choice here: cache 'value' and get rid of 'schema' reference altogether, | ||
| // or retain the reference but be more memory efficient. This code should not stick around for too long | ||
|
|
||
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you planning on writing actual documentation for this eventually? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do right now
In reply to: 224531123 [](ancestors = 224531123)