{"record":{"id":"3dd5ba730f62acfa","repo":"instructure/canvas-lms","slug":"invalid-value-for-name-i","errorCode":null,"errorMessage":"Invalid value for %{name}: \"%{i}\"","messagePattern":"Invalid value for %(.+?): \"%(.+?)\"","errorType":"validation","errorClass":"InvalidDataError","httpStatus":null,"severity":"error","filePath":"lib/outcomes/csv_importer.rb","lineNumber":203,"sourceCode":"        end\n\n        prior = points\n        { points:, description: }\n      end\n    end\n\n    def normalize_i18n(string)\n      raise ArgumentError if string.blank?\n\n      separator = I18n.t(\"number.format.separator\")\n      delimiter = I18n.t(\"number.format.delimiter\")\n      string.gsub(delimiter, \"\").gsub(separator, \".\")\n    end\n\n    def strict_parse_float(v, name)\n      Float(normalize_i18n(v))\n    rescue ArgumentError\n      raise InvalidDataError, I18n.t('Invalid value for %{name}: \"%{i}\"', name:, i: v)\n    end\n\n    def drop_trailing_nils(array)\n      array.pop while array.last.nil? && !array.empty?\n      array\n    end\n  end\nend\n","sourceCodeStart":185,"sourceCodeEnd":212,"githubUrl":"https://github.com/instructure/canvas-lms/blob/1c9f0bb8013ed69c4f2efe11fd483025469b7e6c/lib/outcomes/csv_importer.rb#L185-L212","documentation":"Raised by Outcomes::CsvImporter#strict_parse_float when a value that must be a number (mastery points, rating tier threshold, calculation intensity) cannot be parsed by Ruby's Float(). The value is first passed through normalize_i18n (stripping thousands delimiters, converting decimal separators); only strings still unparsable raise this InvalidDataError naming the field and offending value.","triggerScenarios":"Mastery points cell containing text like 'high' or '3 points'; a value like '1,5.5' that survives i18n normalization; cells with stray characters (currency symbols, spaces-as-thousands that aren't the expected delimiter); an empty-but-present string reached strict_parse_float via a non-blank check path.","commonSituations":"Localized number formats different from the importer's expected delimiters/separators (e.g. unusual thousands separators); typos or units typed into numeric columns; spreadsheet formatting that exported numbers as text with annotations.","solutions":["Enter a plain numeric value in the cell, e.g. 3 or 4.5, with no units or text.","Match the expected number format: the importer's i18n delimiter/separator settings (e.g. 1.234,5 for European formats if configured).","Clean the CSV (strip currency symbols, footnotes, spaces) before import."],"exampleFix":"// before\nmastery_points: \"3 points\"\n// after\nmastery_points: 3","handlingStrategy":"validation","validationCode":"def parseable_float?(v)\n  Float(v.to_s.gsub(',', '').gsub(/\\A\\z/) { })\n  true\nrescue ArgumentError\n  false\nend\nraise 'bad number' unless parseable_float?(row['mastery_points'])","typeGuard":null,"tryCatchPattern":"begin\n  importer.run\nrescue Outcomes::Import::InvalidDataError => e\n  errors << \"Row #{i}: #{e.message}\" # includes offending value\nend","preventionTips":["Numeric cells must contain bare numbers — no units, symbols, or notes","Match the expected i18n decimal/thousands separators","Scrub numeric columns of currency symbols and spaces before import"],"tags":["csv","numeric-parsing","validation","import"],"backgroundTag":"invalid-argument-value","analyzedSha":"1c9f0bb8013ed69c4f2efe11fd483025469b7e6c","analyzedAt":"2026-09-15T20:33:18.891Z","contentChangedAt":"2026-09-15T20:33:18.891Z","schemaVersion":2},"datasetVersion":"2026-09-23T02:17:17.105Z"}