Recidiviz / justice-counts-components

A set of React components powering a web app for exploring centralized, standardized metrics on the performance of justice systems across the United States
GNU General Public License v3.0
1 stars 0 forks source link

Data format should be JSON Lines, not regular JSON #35

Closed colincadams closed 3 years ago

colincadams commented 3 years ago

Describe the bug

Currently the app expects data to be in regular JSON format, like what is in src/data.json. However, it should instead expect the data in JSON lines format so that it conforms with our other products (e.g. JSON files in pulse-data) and can be hooked up directly to BigQuery exports in the future.

To Reproduce Steps to reproduce the behavior:

  1. Replace src/data.json with the fixture file
  2. Run the app
  3. See error
./src/data.json
Module parse failed: Unexpected token { in JSON at position 377 while parsing near '...hange":0.013487476}
{"state_code":"US_AK...'
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
SyntaxError: Unexpected token { in JSON at position 377 while parsing near '...hange":0.013487476}
{"state_code":"US_AK...'
    at JSON.parse (<anonymous>)

Expected behavior

It should instead load the data

Screenshots Screenshots revealing sensitive information must not be shared. If a screenshot is helpful in diagnosing and resolving the bug, please send this directly to a contact on the Recidiviz team.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

jessex commented 3 years ago

@Wmaileq I saw that you moved on to some of the V2 Jails work. But we want to circle back here and finish this one on Monday since it might be the last ticket before we can release V1!