GSS-Cogs / family-covid-19

0 stars 0 forks source link

Error running main.py for ONS-Coronavirus-and-homeworking-in-the-UK #176

Open rg5051 opened 4 years ago

rg5051 commented 4 years ago

I copied the main.py file for ONS-Coronavirus-and-homeworking-in-the-UK and tried to run it in Jupyter. I got the following error message:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-1-41816858c7cf> in <module>
    156 # %%
    157 #scraper = Scraper(landingPage)
--> 158 scraper = Scraper(seed="info.json")
    159 scraper.dataset.title = 'ONS Coronavirus and Homeworking in the UK'
    160 scraper

~/anaconda3/lib/python3.7/site-packages/gssutils/scrape.py in __init__(self, uri, session, seed)
     99             self._dataset_id = parsed_scrape_uri.netloc.replace('.', '/') + parsed_scrape_uri.path
    100         self.update_dataset_uris()
--> 101         self._run()
    102 
    103     def _repr_markdown_(self):

~/anaconda3/lib/python3.7/site-packages/gssutils/scrape.py in _run(self)
    147 
    148                     # Scrape
--> 149                     scrape(self, tree)
    150                     scraped = True
    151 

~/anaconda3/lib/python3.7/site-packages/gssutils/scrapers/ons.py in scrape(scraper, tree)
     40     # literally just whatever's in {"description": {"title": <THIS> }}
     41     # and {"description": {"metaDescription": <THIS> }}
---> 42     scraper.dataset.title = landing_page["description"]["title"].strip()
     43     scraper.dataset.description = landing_page["description"]["metaDescription"]
     44 

KeyError: 'description'

Could someone investigate what's going on here please?

ajtucker commented 4 years ago

@mikeAdamss , does this mean ONS metadata might not have a description key, or have things changed?

rg5051 commented 4 years ago

Looking at Jenkins (thanks @mikeAdamss for the tip 👍 ) it is failing at the Tidy CSV stage: https://ci.floop.org.uk/job/GSS_data/job/COVID-19/job/ONS-Coronavirus-and-homeworking-in-the-UK/