Skip to content
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: Ambiguous call in MapReduce Sample #9998

Closed
joslat opened this issue Dec 17, 2024 · 4 comments · Fixed by #10013
Closed

.Net: Ambiguous call in MapReduce Sample #9998

joslat opened this issue Dec 17, 2024 · 4 comments · Fixed by #10013
Assignees
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code processes samples

Comments

@joslat
Copy link
Contributor

joslat commented Dec 17, 2024

Hi, I am having while building up the .NET Solution an error due to an ambiguous call,

I am getting: "Severity Code Description Project File Line Suppression State
Error CS0121 The call is ambiguous between the following methods or properties: 'string.Split(char[]?, StringSplitOptions)' and 'string.Split(string?, StringSplitOptions)' GettingStartedWithProcesses C:\git\joslat\semantic-kernel\dotnet\samples\GettingStartedWithProcesses\Step05\Step05_MapReduce.cs 119 Active"

Where: \semantic-kernel\dotnet\samples\GettingStartedWithProcesses\Step05\Step05_MapReduce.cs

Image

@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code triage labels Dec 17, 2024
@github-actions github-actions bot changed the title .NET: Ambiguous call in MapReduce.cs .Net: Ambiguous call in MapReduce.cs Dec 17, 2024
@evchaki evchaki added bug Something isn't working processes labels Dec 17, 2024
@evchaki
Copy link
Contributor

evchaki commented Dec 17, 2024

@crickman can you take a look?

@sphenry sphenry removed the triage label Dec 17, 2024
@crickman crickman self-assigned this Dec 18, 2024
@crickman crickman moved this to Sprint: In Progress in Semantic Kernel Dec 18, 2024
@crickman
Copy link
Contributor

@joslat - I'm not able to reproduce this error and its not occuring in our build / release pipeline. I'm guessing there's some different between our build / development environments. In anycase, I can switch this to an array of strings to get around the ambitugity on your system.

@crickman crickman moved this from Sprint: In Progress to Sprint: In Review in Semantic Kernel Dec 18, 2024
@joslat
Copy link
Contributor Author

joslat commented Dec 18, 2024

that would do, I changed it to this locally for it to build, for if it helps :)

string[] words = chunk.Split(new char[] { ' ', '\n', '\r', '.', ',', '’' }, StringSplitOptions.RemoveEmptyEntries);

@crickman crickman changed the title .Net: Ambiguous call in MapReduce.cs .Net: Ambiguous call in MapReduce Sample Dec 18, 2024
@crickman
Copy link
Contributor

that would do, I changed it to this locally for it to build, for if it helps :)

string[] words = chunk.Split(new char[] { ' ', '\n', '\r', '.', ',', '’' }, StringSplitOptions.RemoveEmptyEntries);

FWIW: We get warnings/suggestions when using that syntax in our envronment. There's a strong preference for the collection initializer: [...]

github-merge-queue bot pushed a commit that referenced this issue Jan 6, 2025
### 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.
-->

Fixes: #9998

### Description
<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Use a less ambitious pattern for anyone who may have an particularly
sensitive development environment.

### 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
- [X] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working .NET Issue or Pull requests regarding .NET code processes samples
Projects
Status: Sprint: In Review
Development

Successfully merging a pull request may close this issue.

5 participants