-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
.Net: MinHeap and TopNCollection should not be public #3152
Comments
@stephentoub We moved them to separate package Do you have any recommendations here? |
What are the unit tests doing with MinHeap/TopNCollection that they can't do with PriorityQueue, OrderBy.Take, etc.? |
Sorry, I meant unit tests for actual MinHeap/TopNCollection types :)
|
Ok. Writing unit tests for internal functionality is not a good enough reason to make that functionality public. We should make them internal, and either a) use InternalsVisibleTo to test them directly, b) use reflection to test them directly, or c) stop testing them directly and instead test the actual functionality that is exposed and public.
It doesn't need to be deleted. It just shouldn't be public. |
Makes sense, thank you! Will use |
### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Resolves: #3152 This PR contains changes to make Memory Collection types as `internal`. As alternative, developers can use [PriorityQueue](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.priorityqueue-2?view=net-7.0) type, available in .NET 6, 7, 8. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Hide Memory Collection types. 2. Removed unit tests for hidden types, as they are covered with tests for public type that uses them (`VolatileMemoryStore`). ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
…#3175) ### Motivation and Context <!-- Thank you for your contribution to the semantic-kernel repo! Please help reviewers and future users, providing the following information: 1. Why is this change required? 2. What problem does it solve? 3. What scenario does it contribute to? 4. If it fixes an open issue, please link to the issue here. --> Resolves: microsoft#3152 This PR contains changes to make Memory Collection types as `internal`. As alternative, developers can use [PriorityQueue](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.priorityqueue-2?view=net-7.0) type, available in .NET 6, 7, 8. ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> 1. Hide Memory Collection types. 2. Removed unit tests for hidden types, as they are covered with tests for public type that uses them (`VolatileMemoryStore`). ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [x] The code builds clean without any errors or warnings - [x] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [x] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
Important
Labeled Urgent because it may require a breaking change.
#615 was closed as completed with (I thought) the resolution to make MinHeap internal, but in the latest release it's still public. Both it and TopNCollection aren't something that are really in the domain of SK: a developer can use
PriorityQueue<>
in .NET, orOrderBy(...).Take(...)
, or any number of other solutions if they need the equivalent.The text was updated successfully, but these errors were encountered: