0

I was expecting something like this to work:

from odo import odo
import pandas as pd
odo('jsonlines://offentliggoerelser.jsonl', pd.DataFrame)

However, I get an exception

NotImplementedError: Unable to parse uri to data resource: jsonlines://offentliggoerelser.jsonl

The line-delimited JSON file is a fairly straightforward file

{'regNummer': None, 'cvrNummer': 29443920, 'startDato': '2013-07-01', 'dokumentType': 'AARSRAPPORT', 'sidstOpdateret': '2015-01-01T23:00:00.000Z', 'omgoerelse': False, 'sagsNummer': '14-318.972', 'indlaesningsTidspunkt': '2015-04-11T19:22:58.117Z', 'indlaesningsId': None, 'dokumentUrl': 'http://regnskaber.virk.dk/02934492/eGJybHN0b3JlOi8vWC1CMzBFRjcxNi0yMDE1MDEwMV8xNjAwMDBfMjA2L3hicmw.xml', 'offentliggoerelsesTidspunkt': '2015-01-01T23:00:00.000Z', 'slutDato': '2014-06-30'}
{'regNummer': None, 'cvrNummer': 31785219, ...
...

The same error appears with

odo('offentliggoerelser.jsonl', pd.DataFrame)

and

odo('json://offentliggoerelser.jsonl', pd.DataFrame)

Here are a few other cases

from blaze.utils import example
odo(example('iris.csv'), pd.DataFrame)   # works
odo(example('iris.csv'), "json://iris.json")  # works
odo(example('iris.csv'), "jsonlines://iris.jsonl")  # fails

My odo is 0.5.0

Finn Årup Nielsen
  • 6,130
  • 1
  • 33
  • 43

1 Answers1

1

So apparently the file extension is important. This works:

odo(example('iris.csv'), "jsonlines://iris.json")

Renaming my offentliggoerelser.jsonl to offentliggoerelser.json gets me past the NotImplementedError.

Finn Årup Nielsen
  • 6,130
  • 1
  • 33
  • 43