Skip to content

Commit

Permalink
Merge pull request #48 from jenno-verdonck/patch-1
Browse files Browse the repository at this point in the history
Fixes get_definitions failing when get_data wasn't called previously
  • Loading branch information
mrtzh committed May 15, 2024
2 parents d78adc5 + 086003d commit ebace19
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions folktables/load_acs.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def load_definitions(root_dir, year=2018, horizon='1-Year', download=False):
year_string = year if horizon == '1-Year' else f'{year - 4}-{year}'
url = f'https://www2.census.gov/programs-surveys/acs/tech_docs/pums/data_dict/PUMS_Data_Dictionary_{year_string}.csv'

os.makedirs(base_datadir, exist_ok=True)

response = requests.get(url)
with open(file_path, 'wb') as handle:
handle.write(response.content)
Expand Down

0 comments on commit ebace19

Please sign in to comment.