{"record":{"id":"de4ac4fbd8d9e8cb","repo":"dotnet/machinelearning","slug":"strings-mismatchedvaluetype-formatted-with-typeof","errorCode":null,"errorMessage":"Strings.MismatchedValueType (formatted with typeof(string))","messagePattern":"Strings\\.MismatchedValueType \\(formatted with typeof\\(string\\)\\)","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.Data.Analysis/DataFrameColumns/ArrowStringDataFrameColumn.cs","lineNumber":554,"sourceCode":"            }\n\n            ArrowStringDataFrameColumn ret = new ArrowStringDataFrameColumn(Name);\n            for (long i = 0; i < Length; i++)\n            {\n                ret.Append(IsValid(i) ? GetBytes(i) : Encoding.UTF8.GetBytes(value));\n            }\n            return ret;\n        }\n\n        protected override DataFrameColumn FillNullsImplementation(object value, bool inPlace)\n        {\n            if (value is string valueString)\n            {\n                return FillNulls(valueString, inPlace);\n            }\n            else\n            {\n                throw new ArgumentException(String.Format(Strings.MismatchedValueType, typeof(string)), nameof(value));\n            }\n        }\n\n        /// <inheritdoc/>\n        public new ArrowStringDataFrameColumn DropNulls()\n        {\n            return (ArrowStringDataFrameColumn)DropNullsImplementation();\n        }\n\n        protected override DataFrameColumn DropNullsImplementation()\n        {\n            var ret = new ArrowStringDataFrameColumn(Name);\n\n            for (long i = 0; i < Length; i++)\n            {\n                if (IsValid(i))\n                    ret.Append(GetBytes(i));\n            }","sourceCodeStart":536,"sourceCodeEnd":572,"githubUrl":"https://github.com/dotnet/machinelearning/blob/7b76e69cf964daeca3f1377af6bc5543284d56c6/src/Microsoft.Data.Analysis/DataFrameColumns/ArrowStringDataFrameColumn.cs#L536-L572","documentation":"Thrown by ArrowStringDataFrameColumn.FillNullsImplementation when the object passed to FillNulls is not a string. The column stores UTF-8 byte buffers of strings, so only a string replacement value is meaningful; any other runtime type (int, byte[], etc.) triggers this guard, whose message is formatted with typeof(string) to tell the caller the only accepted type.","triggerScenarios":"Thrown at src/Microsoft.Data.Analysis/DataFrameColumns/ArrowStringDataFrameColumn.cs:554 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a string value to DataFrame.FillNulls, e.g. col.FillNulls(\"N/A\") or the in-place overload FillNulls(value, inPlace: true)","If the fill value arrives as object from generic code, check `value is string` before calling and convert or reject it upstream","To fill with a non-string value, first convert the column to a matching primitive column type (e.g. via ConvertTo or ChangeColumnType) and fill there"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}