dotnet / dotnet/machinelearning-modelbuilder
Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
- Lingua principale
- Dockerfile
- Stelle
- 285
- Fork
- 66
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**System Information (please complete the following information):**
- Model Builder Version (available in Manage Extensions dialog): 17.18.4.2425601
- Visual Studio Version: 17.11.5
**Describe the bug**
- Data set is a sample stack overflow data set (from https://www.brentozar.com/archive/2015/10/how-to-download-the-stack-overflow-database-via-bittorrent/)
- Tried to add SQL Server data from the Posts table, but get the error _"Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')"_
**To Reproduce**
Steps to reproduce the behavior:
1. Download any database from above link, and attach database in SQL Server
2. In Visual Studio, select Add > Machine Learning Model
3. Click on 'Data Classification' > Next Step
4. Select SQL Server and then choose "Microsoft SQL Server" as the data source. Enter database connection details (database is on local machine)
5. Select the "Posts" table.
6. At this point get the error above.
**Expected behavior**
Selecting other tables, such as "Comments" shows a preview of the data.
**Screenshots**
See stack trace below which is the same as displayed in the Model Builder Error dialog.
**Additional context**
```
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.LoadingData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.IsLabelColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.IsUserColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.IsTextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.IsItemColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8428 DEBUG update DataTextViewModel_54.IsSourceSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.IsSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.IsComparisonSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.IsContextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.IsQuestionColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.IsAnswerIndexStartColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.DataPreviewGridVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:30.8570 DEBUG update DataTextViewModel_54.SelectDataToSeePreviewVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.6514 DEBUG update DataTextViewModel_54.FileData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.6514 DEBUG update DataTabDataContext_53.GetSampleDataAsync (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.6514 DEBUG update DataTextViewModel_54.LoadingData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.6514 DEBUG update DataTextViewModel_54.DataTable (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.6998 DEBUG update DataTabDataContext_53.SampleData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7008 DEBUG update DataTextViewModel_54.IsLabelColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7008 DEBUG update DataTextViewModel_54.DataView (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7008 DEBUG update DataTabDataContext_53.IsCompleted (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7008 DEBUG update DataTextViewModel_54.IsUserColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7008 DEBUG update DataTextViewModel_54.DataPreviewGridVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7439 DEBUG update ModelBuilderDataContext_0.GetCompletedTabAsync (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7484 DEBUG update DataTextViewModel_54.IsTextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.7484 DEBUG update DataTextViewModel_54.OnColumnPropertiesChange_RowColSummaryAsync (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.8896 DEBUG update EvaluateViewModel_59.SetUpTryOutRowAsync (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.8896 DEBUG update DataTextViewModel_54.IsItemColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9166 DEBUG update EvaluateViewModel_59.TryOutRow (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9303 DEBUG update DataTextViewModel_54.IsSourceSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9374 DEBUG update EvaluateViewModel_59.TopFiveRecommendationLabel (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9374 DEBUG update EvaluateViewModel_59.IsTryOutItemIdValueInDataset (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9374 DEBUG update DataTextViewModel_54.IsSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9527 DEBUG update DataTextViewModel_54.LoadingData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9527 DEBUG update EvaluateViewModel_59.IsTryOutUserIdValueInDataset (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9527 DEBUG update DataTextViewModel_54.IsComparisonSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9527 DEBUG update DataTextViewModel_54.IsLabelColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9675 DEBUG update DataTextViewModel_54.IsContextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9675 DEBUG update DataTextViewModel_54.IsUserColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9675 DEBUG update DataTextViewModel_54.IsQuestionColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9675 DEBUG update DataTextViewModel_54.IsTextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9825 DEBUG update DataTextViewModel_54.IsItemColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9675 DEBUG update DataTextViewModel_54.IsAnswerIndexStartColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9825 DEBUG update DataTextViewModel_54.IsSourceSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9825 DEBUG update DataTextViewModel_54.DataPreviewGridVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9825 DEBUG update DataTextViewModel_54.IsSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9825 DEBUG update DataTextViewModel_54.SelectDataToSeePreviewVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9976 DEBUG update DataTextViewModel_54.IsComparisonSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9976 DEBUG update DataTextViewModel_54.IsContextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9976 DEBUG update DataTextViewModel_54.IsQuestionColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:31.9976 DEBUG update DataTextViewModel_54.IsAnswerIndexStartColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:32.0133 DEBUG update DataTextViewModel_54.DataPreviewGridVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:32.0133 DEBUG update DataTextViewModel_54.SelectDataToSeePreviewVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:28:32.1298 DEBUG update DataTextViewModel_54.SelectDataToSeePreviewVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.LoadingData (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.IsLabelColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.IsUserColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.IsTextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.IsItemColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2812 DEBUG update DataTextViewModel_54.IsSourceSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.IsSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.IsComparisonSentenceColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.IsContextColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.IsQuestionColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.IsAnswerIndexStartColumnEnabled (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.2942 DEBUG update DataTextViewModel_54.DataPreviewGridVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:03.3102 DEBUG update DataTextViewModel_54.SelectDataToSeePreviewVisible (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
2024-10-31 15:29:04.0555 DEBUG Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at StreamJsonRpc.JsonRpc.d__154`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.Actions.DataTextActions.d__14.MoveNext() in /_/src/Microsoft.ML.ModelBuilder/Actions/DataTextActions.cs:line 284
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.Actions.DataTextActions.d__5.MoveNext() in /_/src/Microsoft.ML.ModelBuilder/Actions/DataTextActions.cs:line 114
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.ML.ModelBuilder.ToolWindows.TextDataControl.<>c__DisplayClass4_0.<b__0>d.MoveNext() in /_/src/Microsoft.ML.ModelBuilder/ToolWindows/DataTabComponents/TextDataControl.xaml.cs:line 108 (Microsoft.ML.ModelBuilder.Utils.Logger.Debug)
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia da src/Microsoft.ML.ModelBuilder/Actions/DataTextActions.cs alle righe di GetCsvDataProgramAsync, riga 284, e SetDatabaseTableAsync, riga 114, quindi segui il percorso di selezione della tabella in ToolWindows/DataTabComponents/TextDataControl.xaml.cs, riga 108. Riproduci il problema con la tabella Stack Overflow Posts e confrontalo con la tabella Comments funzionante; il lavoro è completato quando Posts può essere selezionata e viene visualizzata la relativa anteprima dei dati senza l’eccezione di indice.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp, sql
- Ambito
- data, databases, desktop
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100