{"record":{"id":"31e495cc2e95e771","repo":"dotnet/machinelearning","slug":"string-format-microsoft-data-strings-notsupportedc","errorCode":null,"errorMessage":"String.Format(Microsoft.Data.Strings.NotSupportedColumnType, type.RawType.Name)","messagePattern":"String\\.Format\\(Microsoft\\.Data\\.Strings\\.NotSupportedColumnType, type\\.RawType\\.Name\\)","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.Data.Analysis/IDataView.Extension.cs","lineNumber":125,"sourceCode":"                else if (type == NumberDataViewType.UInt64)\n                {\n                    dataFrameColumns.Add(new UInt64DataFrameColumn(dataViewColumn.Name));\n                }\n                else if (type == NumberDataViewType.UInt16)\n                {\n                    dataFrameColumns.Add(new UInt16DataFrameColumn(dataViewColumn.Name));\n                }\n                else if (type == TextDataViewType.Instance)\n                {\n                    dataFrameColumns.Add(new StringDataFrameColumn(dataViewColumn.Name));\n                }\n                else if (type is VectorDataViewType vectorType)\n                {\n                    dataFrameColumns.Add(GetVectorDataFrame(vectorType, dataViewColumn.Name));\n                }\n                else\n                {\n                    throw new NotSupportedException(String.Format(Microsoft.Data.Strings.NotSupportedColumnType, type.RawType.Name));\n                }\n            }\n\n            using (DataViewRowCursor cursor = dataView.GetRowCursor(activeDataViewColumns))\n            {\n                Delegate[] activeColumnDelegates = new Delegate[activeDataViewColumns.Count];\n                int columnIndex = 0;\n                foreach (DataViewSchema.Column activeDataViewColumn in activeDataViewColumns)\n                {\n                    Delegate valueGetter = dataFrameColumns[columnIndex].GetValueGetterUsingCursor(cursor, activeDataViewColumn);\n                    activeColumnDelegates[columnIndex] = valueGetter;\n                    columnIndex++;\n                }\n                while (cursor.MoveNext() && cursor.Position < maxRows)\n                {\n                    for (int i = 0; i < activeColumnDelegates.Length; i++)\n                    {\n                        dataFrameColumns[i].AddValueUsingCursor(cursor, activeColumnDelegates[i]);","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.Data.Analysis/IDataView.Extension.cs#L107-L143","documentation":"ToDataFrame can only map column kinds it knows (supported primitives and vector types); when a column's DataViewType is neither, it throws NotSupportedException(Strings.NotSupportedColumnType, type.RawType.Name). The DataFrame column model has no representation for that type.","triggerScenarios":"Calling dataView.ToDataFrame() on a schema containing a column whose type is not a supported scalar primitive nor a handled VectorDataViewType — e.g. key-type columns or blittable struct columns.","commonSituations":"Pipelines emitting key-typed or custom-mapped columns; converting ML.NET transform outputs beyond the extension's supported set; schema drift after changing a pipeline stage.","solutions":["Drop unsupported columns before conversion via ColumnSelectingTransformer.","Convert key-typed columns to primitives with KeyToValueMapping/KeyToVectorMapping first.","Inspect dataView.Schema up front and skip columns whose Type is unsupported.","Copy unsupported columns manually into primitive/VBuffer columns yourself."],"exampleFix":"// before\nvar df = pipelineOutput.ToDataFrame(); // schema has key-typed column\n// after\nvar select = new ColumnSelectingTransformer(env, keepColumns: supportedColumnNames);\nvar df = select.Transform(pipelineOutput).ToDataFrame();","handlingStrategy":"validation","validationCode":"bool convertible = dataView.Schema.All(s =>\n    s.Type is VectorDataViewType || s.Type is PrimitiveDataViewType);\nif (!convertible) throw new InvalidOperationException(\"Schema has unsupported column types; filter them first\");","typeGuard":"bool isConvertibleColumn(DataViewSchema.Column c) => c.Type is VectorDataViewType || c.Type is PrimitiveDataViewType;","tryCatchPattern":"try { var df = dataView.ToDataFrame(); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"column\"))\n{ /* unsupported column type: select/drop columns and retry */ }","preventionTips":["Filter the schema to primitive/vector columns before conversion.","Transform key-typed columns to primitives first.","Inspect dataView.Schema in tests for every pipeline change.","Pin transform stages so schema drift is caught early."],"tags":["not-supported-exception","idataview","dataframe","column-type"],"backgroundTag":"unsupported-operation","analyzedSha":"7b76e69cf964daeca3f1377af6bc5543284d56c6","analyzedAt":"2026-09-11T12:35:38.930Z","contentChangedAt":"2026-09-11T12:35:38.930Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}