VizierDB / web-ui

Web User Interface
Apache License 2.0
12 stars 2 forks source link

Can't create new dataset in Vizier #44

Closed okennedy closed 6 years ago

okennedy commented 6 years ago
import json
from urllib2 import urlopen

source = 'https://raw.githubusercontent.com/thebuffalonews/shootings/master/data_cleanup/erie-census-block-group-14.geojson'

f = urlopen(source)
data = json.loads(f.read())
f.close()

schema = list(set([ 
    key
    for row in data[u"features"]
    for key in row.keys()
  ]))
print(schema)

ds = vizierdb.new_dataset()
for col in schema:
    ds.insert_column(col)
for row in data[u"features"]:
    ds.insert_row(values=[ row[key] for key in schema ])
vizierdb.create_dataset('ErieCountyBlocks', ds)

Errors with a IOError:(2, 'No such file or directory') on the spark build. The line it errors on is the very last one vizierdb.create_dataset('ErieCountyBlocks', ds)

mrb24 commented 6 years ago

Fixed