hdx-python-api 6.4.3__tar.gz → 6.4.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/PKG-INFO +1 -1
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/documentation/index.md +46 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/requirements.txt +10 -8
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/_version.py +2 -2
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/hdx_error_handler.py +11 -3
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_hdx_error_handler.py +27 -1
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/.coveragerc +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/.github/workflows/publish.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/.github/workflows/run-python-tests.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/.gitignore +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/.pre-commit-config.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/CONTRIBUTING.md +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/LICENSE +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/README.md +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/documentation/.readthedocs.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/documentation/mkdocs.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/hatch.toml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/pyproject.toml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/pytest.ini +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/ruff.toml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/configuration.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/hdx_base_configuration.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/locations.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/remotehdx.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/dataset_title_helper.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/date_helper.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/filestore_helper.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/api/utilities/hdx_state.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/dataset.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/hdxobject.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/indicator_resource_view_template.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/organization.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/resource.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/resource_matcher.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/resource_view.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/showcase.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/user.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/vocabulary.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/facades/infer_arguments.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/facades/keyword_arguments.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/facades/simple.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/Accepted_Tags.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/CKAN/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/Tag_Mapping.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/Tag_Mapping_ChainRuleError.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/empty.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_base_config.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_base_config.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_config.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_config.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_dataset_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_dataset_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_datasource_topline.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_datasource_topline.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_email_configuration.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_email_configuration.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_missing_site_config.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_organization_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_organization_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_view_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_view_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_showcase_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_showcase_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_user_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_user_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_vocabulary_static.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_vocabulary_static.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/project_configuration.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/project_configuration.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/user_agent_config.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/user_agent_config2.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/user_agent_config3.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/user_agent_config_wrong.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/dataset_search_results.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/datastore/ACLED-All-Africa-File_20170101-to-20170708.xlsx +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/empty.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/conflict_data_alg.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/min_qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/test_data_no_data.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/test_data_no_years.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/organization_show_results.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/qc_from_rows/qc_conflict_data_alg_one_col.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/resource_formats.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/showcase_all_search_results.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/state/analysis_dates.txt +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/state/last_build_date.txt +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/test_data.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/test_data.zip +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/dem_data_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/dem_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/expected_resources_to_update.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/opri_data_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/opri_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/opri_metadata_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/qc_sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/sdg_data_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/sdg_indicatorlist_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/sdg_metadata_zwe.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/unesco_dataset.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_dataset_resources/unesco_update_dataset.json +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_logic/update_logic_resources.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/update_logic/update_logic_resources_new.yaml +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/test_ckan.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/test_configuration.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/test_locations.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_dataset_title_helper.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_filestore_helper.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_hdx_state.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/conftest.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_dataset_add_hapi_error.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_dataset_core.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_dataset_noncore.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_dataset_resource_generation.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_organization.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_resource.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_resource_view.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_showcase.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_update_dataset_resources.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_update_logic.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_user.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_vocabulary.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/facades/__init__.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/facades/test_infer_arguments.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/facades/test_keyword_arguments.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/facades/test_simple.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/workingexample/my_code.py +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/workingexample/my_resource.csv +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/workingexample/my_resource.xlsx +0 -0
- {hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/workingexample/run.py +0 -0
|
@@ -34,6 +34,7 @@ upload your datasets to HDX.
|
|
|
34
34
|
- [User Management](#user-management)
|
|
35
35
|
- [Organization Management](#organization-management)
|
|
36
36
|
- [Vocabulary Management](#vocabulary-management)
|
|
37
|
+
- [Pipeline State](#pipeline-state)
|
|
37
38
|
- [Working Examples](#working-examples)
|
|
38
39
|
- [Project Framework](#project-framework)
|
|
39
40
|
- [IDMC Example](#idmc-example)
|
|
@@ -1088,6 +1089,51 @@ If you want to add a list of tags, you do it as follows:
|
|
|
1088
1089
|
|
|
1089
1090
|
vocabulary.add_tags(["TAG","TAG","TAG"...])
|
|
1090
1091
|
|
|
1092
|
+
## Pipeline State
|
|
1093
|
+
|
|
1094
|
+
The HDXState class allows the reading and writing of state to a given dataset. Input
|
|
1095
|
+
and output state transformations can be supplied in read_fn and write_fn
|
|
1096
|
+
respectively. The input state transformation takes in a string while the output
|
|
1097
|
+
transformation outputs a string. It is used as follows:
|
|
1098
|
+
|
|
1099
|
+
with temp_dir(folder="test_state") as tmpdir:
|
|
1100
|
+
statepath = join(tmpdir, statefile)
|
|
1101
|
+
copyfile(join(statefolder, statefile), statepath)
|
|
1102
|
+
date1 = datetime(2020, 9, 23, 0, 0, tzinfo=timezone.utc)
|
|
1103
|
+
date2 = datetime(2022, 5, 12, 10, 15, tzinfo=timezone.utc)
|
|
1104
|
+
with HDXState(
|
|
1105
|
+
"test_dataset", tmpdir, parse_date, iso_string_from_datetime
|
|
1106
|
+
) as state:
|
|
1107
|
+
assert state.get() == date1
|
|
1108
|
+
state.set(date2)
|
|
1109
|
+
with HDXState(
|
|
1110
|
+
"test_dataset", tmpdir, parse_date, iso_string_from_datetime
|
|
1111
|
+
) as state:
|
|
1112
|
+
assert state.get() == date2.replace(hour=0, minute=0)
|
|
1113
|
+
|
|
1114
|
+
with HDXState(
|
|
1115
|
+
"test_dataset",
|
|
1116
|
+
tmpdir,
|
|
1117
|
+
HDXState.dates_str_to_country_date_dict,
|
|
1118
|
+
HDXState.country_date_dict_to_dates_str,
|
|
1119
|
+
) as state:
|
|
1120
|
+
state_dict = state.get()
|
|
1121
|
+
assert state_dict == {"DEFAULT": date1}
|
|
1122
|
+
state_dict["AFG"] = date2
|
|
1123
|
+
state.set(state_dict)
|
|
1124
|
+
with HDXState(
|
|
1125
|
+
"test_dataset",
|
|
1126
|
+
tmpdir,
|
|
1127
|
+
HDXState.dates_str_to_country_date_dict,
|
|
1128
|
+
HDXState.country_date_dict_to_dates_str,
|
|
1129
|
+
) as state:
|
|
1130
|
+
state_dict = state.get()
|
|
1131
|
+
assert state_dict == {
|
|
1132
|
+
"DEFAULT": date1,
|
|
1133
|
+
"AFG": date2.replace(hour=0, minute=0),
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
|
|
1091
1137
|
# Working Examples
|
|
1092
1138
|
|
|
1093
1139
|
For a working example of downloading data in a dataset on HDX, see
|
|
@@ -26,13 +26,13 @@ charset-normalizer==3.4.2
|
|
|
26
26
|
# via requests
|
|
27
27
|
ckanapi==4.8
|
|
28
28
|
# via hdx-python-api (pyproject.toml)
|
|
29
|
-
click==8.1
|
|
29
|
+
click==8.2.1
|
|
30
30
|
# via
|
|
31
31
|
# mkdocs
|
|
32
32
|
# typer
|
|
33
33
|
colorama==0.4.6
|
|
34
34
|
# via mkdocs-material
|
|
35
|
-
coverage==7.8.
|
|
35
|
+
coverage==7.8.2
|
|
36
36
|
# via pytest-cov
|
|
37
37
|
defopt==6.4.0
|
|
38
38
|
# via hdx-python-api (pyproject.toml)
|
|
@@ -72,7 +72,7 @@ hdx-python-utilities==3.8.7
|
|
|
72
72
|
# hdx-python-country
|
|
73
73
|
humanize==4.12.3
|
|
74
74
|
# via frictionless
|
|
75
|
-
identify==2.6.
|
|
75
|
+
identify==2.6.12
|
|
76
76
|
# via pre-commit
|
|
77
77
|
idna==3.10
|
|
78
78
|
# via
|
|
@@ -96,7 +96,7 @@ jsonlines==4.0.0
|
|
|
96
96
|
# via hdx-python-utilities
|
|
97
97
|
jsonpath-ng==1.7.0
|
|
98
98
|
# via libhxl
|
|
99
|
-
jsonschema==4.
|
|
99
|
+
jsonschema==4.24.0
|
|
100
100
|
# via
|
|
101
101
|
# frictionless
|
|
102
102
|
# tableschema-to-template
|
|
@@ -129,7 +129,7 @@ mergedeep==1.3.4
|
|
|
129
129
|
# via
|
|
130
130
|
# mkdocs
|
|
131
131
|
# mkdocs-get-deps
|
|
132
|
-
mkapi==4.4.
|
|
132
|
+
mkapi==4.4.1
|
|
133
133
|
# via hdx-python-api (pyproject.toml)
|
|
134
134
|
mkdocs==1.6.1
|
|
135
135
|
# via
|
|
@@ -256,9 +256,11 @@ rpds-py==0.25.1
|
|
|
256
256
|
# referencing
|
|
257
257
|
rsa==4.9.1
|
|
258
258
|
# via google-auth
|
|
259
|
-
ruamel-yaml==0.18.
|
|
259
|
+
ruamel-yaml==0.18.11
|
|
260
260
|
# via hdx-python-utilities
|
|
261
|
-
|
|
261
|
+
ruamel-yaml-clib==0.2.12
|
|
262
|
+
# via ruamel-yaml
|
|
263
|
+
setuptools==80.9.0
|
|
262
264
|
# via ckanapi
|
|
263
265
|
shellingham==1.5.4
|
|
264
266
|
# via typer
|
|
@@ -286,7 +288,7 @@ text-unidecode==1.3
|
|
|
286
288
|
# via python-slugify
|
|
287
289
|
typeguard==4.4.2
|
|
288
290
|
# via inflect
|
|
289
|
-
typer==0.
|
|
291
|
+
typer==0.16.0
|
|
290
292
|
# via frictionless
|
|
291
293
|
typing-extensions==4.13.2
|
|
292
294
|
# via
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from os import getenv
|
|
2
3
|
from typing import Any, Tuple
|
|
3
4
|
|
|
4
5
|
from hdx.data.dataset import Dataset
|
|
@@ -19,17 +20,24 @@ class HDXErrorHandler(ErrorHandler):
|
|
|
19
20
|
|
|
20
21
|
Args:
|
|
21
22
|
should_exit_on_error (bool): Whether to exit with a 1 code if there are errors. Default is False.
|
|
22
|
-
write_to_hdx (
|
|
23
|
+
write_to_hdx (Any): Whether to write errors to HDX resources. Default is None (write errors).
|
|
23
24
|
|
|
24
25
|
"""
|
|
25
26
|
|
|
26
27
|
def __init__(
|
|
27
28
|
self,
|
|
28
29
|
should_exit_on_error: bool = False,
|
|
29
|
-
write_to_hdx:
|
|
30
|
+
write_to_hdx: Any = None,
|
|
30
31
|
):
|
|
31
32
|
super().__init__(should_exit_on_error)
|
|
32
|
-
|
|
33
|
+
if write_to_hdx is None:
|
|
34
|
+
write_to_hdx = getenv("ERR_TO_HDX", True)
|
|
35
|
+
if write_to_hdx in (False, 0, "false", "False", "FALSE", "N", "n", ""):
|
|
36
|
+
self._write_to_hdx = False
|
|
37
|
+
logger.info("Errors won't be written to HDX")
|
|
38
|
+
else:
|
|
39
|
+
self._write_to_hdx = True
|
|
40
|
+
logger.info("Errors will be written to HDX")
|
|
33
41
|
self.shared_errors["hdx_error"] = {}
|
|
34
42
|
|
|
35
43
|
@staticmethod
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_hdx_error_handler.py
RENAMED
|
@@ -12,9 +12,35 @@ setup_logging()
|
|
|
12
12
|
|
|
13
13
|
class TestHDXErrorHandler:
|
|
14
14
|
def test_hdx_error_handler(self, caplog):
|
|
15
|
+
error_handler = HDXErrorHandler()
|
|
16
|
+
assert error_handler._write_to_hdx is True
|
|
17
|
+
error_handler = HDXErrorHandler(write_to_hdx=None)
|
|
18
|
+
assert error_handler._write_to_hdx is True
|
|
19
|
+
error_handler = HDXErrorHandler(write_to_hdx="true")
|
|
20
|
+
assert error_handler._write_to_hdx is True
|
|
21
|
+
error_handler = HDXErrorHandler(write_to_hdx="Y")
|
|
22
|
+
assert error_handler._write_to_hdx is True
|
|
23
|
+
error_handler = HDXErrorHandler(write_to_hdx=True)
|
|
24
|
+
assert error_handler._write_to_hdx is True
|
|
25
|
+
error_handler = HDXErrorHandler(write_to_hdx=1)
|
|
26
|
+
assert error_handler._write_to_hdx is True
|
|
27
|
+
error_handler = HDXErrorHandler(write_to_hdx="")
|
|
28
|
+
assert error_handler._write_to_hdx is False
|
|
29
|
+
error_handler = HDXErrorHandler(write_to_hdx="false")
|
|
30
|
+
assert error_handler._write_to_hdx is False
|
|
31
|
+
error_handler = HDXErrorHandler(write_to_hdx="FALSE")
|
|
32
|
+
assert error_handler._write_to_hdx is False
|
|
33
|
+
error_handler = HDXErrorHandler(write_to_hdx="n")
|
|
34
|
+
assert error_handler._write_to_hdx is False
|
|
35
|
+
error_handler = HDXErrorHandler(write_to_hdx=False)
|
|
36
|
+
assert error_handler._write_to_hdx is False
|
|
37
|
+
error_handler = HDXErrorHandler(write_to_hdx=0)
|
|
38
|
+
assert error_handler._write_to_hdx is False
|
|
15
39
|
with pytest.raises(SystemExit):
|
|
16
40
|
with caplog.at_level(logging.ERROR):
|
|
17
|
-
with HDXErrorHandler(
|
|
41
|
+
with HDXErrorHandler(
|
|
42
|
+
should_exit_on_error=True, write_to_hdx=False
|
|
43
|
+
) as errors:
|
|
18
44
|
errors.add_message(
|
|
19
45
|
"pipeline1",
|
|
20
46
|
"dataset1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/src/hdx/data/indicator_resource_view_template.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_datasource_topline.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_datasource_topline.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_email_configuration.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_email_configuration.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_missing_site_config.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_organization_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_organization_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_view_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_resource_view_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_showcase_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_showcase_static.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_vocabulary_static.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/hdx_vocabulary_static.yaml
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/project_configuration.json
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/project_configuration.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/config/user_agent_config_wrong.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/conflict_data_alg.csv
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/qc_conflict_data_alg.csv
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/test_data_no_data.csv
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/gen_resource/test_data_no_years.csv
RENAMED
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/qc_from_rows/qc_conflict_data_alg.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/fixtures/showcase_all_search_results.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_dataset_title_helper.py
RENAMED
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/api/utilities/test_filestore_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_dataset_resource_generation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hdx_python_api-6.4.3 → hdx_python_api-6.4.4}/tests/hdx/data/test_update_dataset_resources.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|