Skip to content

Commit

Permalink
Fixes get_definitions failing when get_data wasn't called previously
Browse files Browse the repository at this point in the history
  • Loading branch information
jenno-verdonck authored May 13, 2024
1 parent d78adc5 commit 086003d
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 086003d

Please sign in to comment.