{"record":{"id":"a2b4a550827042b2","repo":"dotnet/machinelearning","slug":"the-data-type-datakind-is-not-handled-currentl","errorCode":null,"errorMessage":"The data type '{dataKind}' is not handled currently.","messagePattern":"The data type '(.+?)' is not handled currently\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.ML.CodeGenerator/Utils.cs","lineNumber":362,"sourceCode":"            {\n                case DataKind.String:\n                    return Symbols.StringSymbol;\n                case DataKind.Boolean:\n                    return Symbols.BoolSymbol;\n                case DataKind.Single:\n                    return Symbols.FloatSymbol;\n                case DataKind.Double:\n                    return Symbols.DoubleSymbol;\n                case DataKind.Int32:\n                    return Symbols.IntSymbol;\n                case DataKind.UInt32:\n                    return Symbols.UIntSymbol;\n                case DataKind.Int64:\n                    return Symbols.LongSymbol;\n                case DataKind.UInt64:\n                    return Symbols.UlongSymbol;\n                default:\n                    throw new ArgumentException($\"The data type '{dataKind}' is not handled currently.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":344,"sourceCodeEnd":367,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.ML.CodeGenerator/Utils.cs#L344-L367","documentation":"Utils.GetSymbolOfDataKind resolves a DataKind to the corresponding CSharpCodeProvider code-dom type symbol (Symbols.*). When the DataKind isn't one of the handled cases the default branch throws this ArgumentException. It's raised while GenerateClassLabels builds class/enum declarations for generated C# code, meaning the column's data type cannot be represented by the generator.","triggerScenarios":"GenerateClassLabels processes a pipeline node whose column/label DataKind is outside the handled set (Boolean, DateTime, TimeSpan, String, etc.), so GetSymbolOfDataKind hits its default throw while emitting the C# class.","commonSituations":"Datasets with bool/datetime/string feature columns being converted to C# by mlnet codegen; version drift where newer DataKind values exist; columns loaded via custom IDataView loaders with unusual types.","solutions":["Pre-convert the offending column to a supported numeric kind (mlContext.Transforms.Conversion.ConvertType) before code generation.","Upgrade Microsoft.ML.CodeGenerator to a build that maps your DataKind to a symbol.","Filter out or rename unsupported columns before running AutoML + codegen.","Extend GetSymbolOfDataKind with a case for the missing DataKind if you control the source."],"exampleFix":"// before\nvar pipeline = mlContext.Transforms.Concatenate(\"Features\", \"IsWeekend\", \"Amount\");\n// after: convert bool column to a handled kind first\nvar pipeline = mlContext.Transforms.Conversion.ConvertType(\"IsWeekendNum\", \"IsWeekend\", outputKind: DataKind.Single)\n    .Append(mlContext.Transforms.Concatenate(\"Features\", \"IsWeekendNum\", \"Amount\"));","handlingStrategy":"validation","validationCode":"var supported = new HashSet<DataKind> { DataKind.Single, DataKind.Double, DataKind.Int32,\n    DataKind.UInt32, DataKind.Int64, DataKind.UInt64, DataKind.Int16, DataKind.UInt16, DataKind.Byte, DataKind.SByte };\nforeach (var col in schema)\n    if (!supported.Contains(((DataViewType)col.Type).GetRawKind().GetValueOrDefault()))\n        throw new InvalidOperationException($\"Column {col.Name} kind unsupported for codegen\");","typeGuard":"static bool IsSymbolSupported(DataKind kind) => kind is DataKind.Single or DataKind.Double\n    or DataKind.Int32 or DataKind.UInt32 or DataKind.Int64 or DataKind.UInt64\n    or DataKind.Int16 or DataKind.UInt16 or DataKind.Byte or DataKind.SByte;","tryCatchPattern":"try\n{\n    var symbol = Utils.GetSymbolOfDataKind(kind);\n}\ncatch (ArgumentException ex) when (ex.Message.Contains(\"is not handled currently\"))\n{\n    symbol = null; // skip emitting this column, log the kind\n}","preventionTips":["Pre-convert bool/datetime/string feature columns with ConvertType before codegen.","Audit column kinds in your pipeline before conversion to C#.","Keep CodeGenerator aligned with the DataKind set in your Microsoft.ML packages.","Handle unrepresentable columns by excluding them from Features explicitly."],"tags":["mlnet","datakind","codegen","type-mapping"],"backgroundTag":"unsupported-dtype","analyzedSha":"7b76e69cf964daeca3f1377af6bc5543284d56c6","analyzedAt":"2026-09-11T12:35:38.930Z","contentChangedAt":"2026-09-11T12:35:38.930Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}