observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Integer columns are importing as text #487

Closed KathrynC closed 1 year ago

KathrynC commented 1 year ago

I am working with a table of Blood Glucose test readings. As of yesterday, the integer column of test results is being interpreted by the parser as a string rather than an integer or a number.

Even when I export from Observables an array that works from yesterday and reimport it today, the integers are not parsed as integers.

To Reproduce Steps to reproduce the behavior:

  1. Export an array that has an integer column from Observables which has, for example, integers in the 90s and in the low 100s.
  2. Reimport it.
  3. View this data and sort by the integer colum.
  4. See that it thinks 98 is larger than 103 (or 900 for that matter). Attached image shows that the integers are not being handled as integers.

Expected behavior Integers should be sorted by numerical value.

Screenshots If applicable, add screenshots to help explain your problem.

Screen Shot 2022-10-10 at 8 34 39 AM

Desktop (please complete the following information):

Additional context If this is a bug, it is something that has changed in the last 24 hours.

mbostock commented 1 year ago

If you’re using a CSV file, you need to add {typed: true} to infer types (or use array.map to set the types of columns yourself); see File Attachments for more.

KathrynC commented 1 year ago

Yup. That works to fix the problem.

Thanks.