Closed jsanz closed 5 years ago
cc @alrocar
Hi @jsanz!
Could you test your example with this branch 754-fix-upload
?
Bonus, you can render directly the dataframe:
Hi tried 754-fix-upload
and apart that I had to fix the datasets
module rename everything worked fine!
V-A-M-O-S !
\o/
Fixed in #763
Using
develop
, I'm getting a weird error withDataset.upload
method. It's working fine with other Dataframes, maybe the JSON types are messing the upload?This is the error trace. You have below on the details the testing script.
Test script
### Testing script ```python import pandas as pd # Use Pandas to read a JSON of Citibike stations and their statuses stations_data = pd.read_json('https://gbfs.citibikenyc.com/gbfs/en/station_information.json') stations = pd.DataFrame(stations_data.data[0]) status_data = pd.read_json('https://gbfs.citibikenyc.com/gbfs/en/station_status.json') status = pd.DataFrame(status_data.data[0]) # Join the station and statuses together by 'station_id' station_status = pd.merge(stations,status,how='left', on='station_id') # Initialize cartoframes import os, cartoframes from cartoframes import Credentials USERNAME = os.getenv('CARTO_USER') APIKEY = os.getenv('CARTO_API_KEY') creds = Credentials(username=USERNAME, key=APIKEY) cc = cartoframes.CartoContext(creds=creds) # upload the dataframe from cartoframes.datasets import Dataset d = Dataset.from_dataframe(station_status) d.upload(table_name='cb_stations_status', if_exists="replace", with_lnglat=('lon','lat'), context=cc, schema=cc.get_default_schema()) ```