enzoampil / phcovid

Easy access to updated PH COVID data
MIT License
13 stars 3 forks source link

Error in get_features #40

Closed mgmanalili closed 4 years ago

mgmanalili commented 4 years ago

I am getting an error recently since it cannot fetch features from remote service (I suppose an ArcGIS feature)

Before, I was able to call it as shown in the notebook example but now, it returns no df or features.

Also, since json_normalize is now deprecated, I would suggest to use flatten_json

from phcovid import get_cases
df = get_cases()

KeyError                                  Traceback (most recent call last)
<timed exec> in <module>

c:\users\michael\anaconda3\envs\covid19\lib\site-packages\phcovid\phcovid.py in get_cases(rename_dict, val_alias, none_alias, gsheet_target_cols)
    117     """
    118     raw = extract_arcgis_data()
--> 119     df = json_normalize(raw["features"])
    120     df_renamed = df[rename_dict.keys()].rename(columns=rename_dict)
    121 

KeyError: 'features'
marlteodosio commented 4 years ago

I'm encountering the same problem. I hope you can fix it. Thanks! :)

enzoampil commented 4 years ago

Hi guys, apologies for this. This related to the revoked access to the ArcGIS dataset shared by DOH; however, we are aware that a new data source is out and are planning to integrate with this new dataset within the next week or two.

ghost commented 4 years ago

Hi guys, we are working to integrate the new DOH COVID-19 datasets into phcovid. Thank you for your patience :)

mamerisawesome commented 4 years ago

Sent a pull request (see #41) to try to alleviate our problem. Let me know what you think once it's merged. 🙂

enzoampil commented 4 years ago

@mgmanalili @marlteodosio We have made the source switch to get data from this new source from DOH. It won't be as complete as before but at the very least it seems to be regularly updated :)

mamerisawesome commented 4 years ago

Closing this issue for now with the DSPH fix over ArcGIS dataset.