Add todo #215
GitHub Actions / Test Results
failed
Jan 30, 2024 in 0s
1 fail, 3 pass in 2m 36s
Annotations
Check warning on line 0 in tests.test_main.TestHAPIPipelines
github-actions / Test Results
test_pipelines (tests.test_main.TestHAPIPipelines) failed
test-results.xml [took 2m 34s]
Raw output
KeyError: 'reference_period'
self = <test_main.TestHAPIPipelines object at 0x7fab50257a90>
configuration = {'hdx_prod_site': {'url': 'https://data.humdata.org'}, 'hdx_demo_site': {'url': 'https://demo.data-humdata-org.ahconu....n+age_70_74+total', '#population+f+age_75_79', '#population+m+age_75_79', '#population+age_75_79+total'], 'list': []}}}
folder = 'tests/fixtures'
def test_pipelines(self, configuration, folder):
with ErrorsOnExit() as errors_on_exit:
with temp_dir(
"TestHAPIPipelines",
delete_on_success=True,
delete_on_failure=False,
) as temp_folder:
dbpath = join(temp_folder, "test_hapi.db")
try:
remove(dbpath)
except OSError:
pass
logger.info(f"Creating database {dbpath}")
with Database(database=dbpath, dialect="sqlite") as session:
today = parse_date("2023-10-11")
Read.create_readers(
temp_folder,
join(folder, "input"),
temp_folder,
False,
True,
today=today,
)
logger.info("Initialising pipelines")
pipelines = Pipelines(
configuration,
session,
today,
errors_on_exit=errors_on_exit,
use_live=False,
)
logger.info("Running pipelines")
pipelines.run()
logger.info("Writing to database")
> pipelines.output()
tests/test_main.py:115:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
src/hapi/pipelines/app/pipelines.py:191: in output
population.populate()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <hapi.pipelines.database.population.Population object at 0x7fab464f7ad0>
def populate(self):
logger.info("Populating population table")
for dataset in self._results.values():
> reference_period_start = dataset["reference_period"]["startdate"]
E KeyError: 'reference_period'
src/hapi/pipelines/database/population.py:43: KeyError
Loading