From f2d77f69e402fc49a9e2b752ae659aa1cab8b794 Mon Sep 17 00:00:00 2001 From: Olivier Sirello Date: Mon, 21 Oct 2024 17:00:30 +0200 Subject: [PATCH 1/2] Fix issue 10 with error warning --- src/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.py b/src/app.py index cc09171..796fed2 100644 --- a/src/app.py +++ b/src/app.py @@ -357,12 +357,16 @@ def load_yaml(href: str): dash_id_url = str(f.path) dash_id_url_s = "".join(dash_id_url.split("/", 1)) + if dash_id_url != "/": + yaml_location = ''.join([d["location"] for d in yaml_files if d['dash_id'] == dash_id_url_s]) + if dash_id_url == "/": raise PreventUpdate yaml_location = "".join( [d["location"] for d in yaml_files if d["dash_id"] == dash_id_url_s] ) + return yaml_location except Exception as e: From 648798e7927ecc02d86acfe13fcbbaae4cdfac8a Mon Sep 17 00:00:00 2001 From: Olivier Sirello Date: Mon, 21 Oct 2024 17:00:45 +0200 Subject: [PATCH 2/2] Upgrade to BIS API v2 and new ILO API --- yaml/bis_data.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/yaml/bis_data.yaml b/yaml/bis_data.yaml index 0a2e915..619b1f6 100644 --- a/yaml/bis_data.yaml +++ b/yaml/bis_data.yaml @@ -16,19 +16,19 @@ Rows: chartType: VALUE Title: Policy rate Subtitle: United States - Unit: "%" + Unit: "%" UnitShow: "Yes" UnitIcon: "bi bi-cash-coin h1" unitLoc: SUFFIX Decimals: 2 LabelsYN: "No" legendConcept: REF_AREA - legendLoc: + legendLoc: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" metadataLink: - DATA: "https://stats.bis.org/api/v1/data/WS_CBPOL_M/M.US/all?detail=full&lastNObservations=1" + DATA: "https://stats.bis.org/api/v2/data/dataflow/BIS/WS_CBPOL/1.0/M.US?detail=full&lastNObservations=1" - Row: 1 chartType: VALUE @@ -41,12 +41,12 @@ Rows: Decimals: 2 LabelsYN: No legendConcept: REF_AREA - legendLoc: + legendLoc: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" metadataLink: - DATA: "https://stats.bis.org/api/v1/data/WS_CBPOL_M/M.XM/all?detail=full&lastNObservations=1" + DATA: "https://stats.bis.org/api/v2/data/dataflow/BIS/WS_CBPOL/1.0/M.XM/all?detail=full&lastNObservations=1" - Row: 1 chartType: VALUE @@ -59,12 +59,12 @@ Rows: Decimals: 2 LabelsYN: No legendConcept: REF_AREA - legendLoc: + legendLoc: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" metadataLink: - DATA: "https://stats.bis.org/api/v1/data/WS_CBPOL_M/M.GB/all?detail=full&lastNObservations=1" + DATA: "https://stats.bis.org/api/v2/data/dataflow/BIS/WS_CBPOL/1.0/M.GB/all?detail=full&lastNObservations=1" - Row: 2 chartType: PIE @@ -79,9 +79,9 @@ Rows: xAxisConcept: REF_AREA yAxisConcept: OBS_VALUE downloadYN: "Yes" - dsdLink: "https://www.ilo.org/sdmx/rest/datastructure/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" - metadataLink: "https://www.ilo.org/sdmx/rest/dataflow/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" - DATA: "https://www.ilo.org/sdmx/rest/data/DF_POP_XWAP_SEX_AGE_NB/FRA+DEU+CAN+USA+GBR+JPN.A.POP_XWAP_NB.SEX_T.AGE_AGGREGATE_TOTAL?endPeriod=2022&lastNObservations=1" + dsdLink: "https://sdmx.ilo.org/rest/datastructure/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" + metadataLink: "https://sdmx.ilo.org/rest/dataflow/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" + DATA: "https://sdmx.ilo.org/rest/data/DF_POP_XWAP_SEX_AGE_NB/FRA+DEU+CAN+USA+GBR+JPN.A.POP_XWAP_NB.SEX_T.AGE_AGGREGATE_TOTAL?endPeriod=2022&lastNObservations=1" - Row: 2 chartType: BAR @@ -96,9 +96,9 @@ Rows: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" - dsdLink: "https://www.ilo.org/sdmx/rest/datastructure/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" - metadataLink: "https://www.ilo.org/sdmx/rest/dataflow/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" - DATA: "https://www.ilo.org/sdmx/rest/data/DF_POP_XWAP_SEX_AGE_NB/FRA+DEU+CAN+USA+GBR+JPN.A.POP_XWAP_NB.SEX_T.AGE_AGGREGATE_TOTAL?endPeriod=2022" + dsdLink: "https://sdmx.ilo.org/rest/datastructure/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" + metadataLink: "https://sdmx.ilo.org/rest/dataflow/ILO/DF_POP_XWAP_SEX_AGE_NB/1.0?detail=full" + DATA: "https://sdmx.ilo.org/rest/data/DF_POP_XWAP_SEX_AGE_NB/FRA+DEU+CAN+USA+GBR+JPN.A.POP_XWAP_NB.SEX_T.AGE_AGGREGATE_TOTAL?endPeriod=2022" - Row: 3 chartType: LINE @@ -113,9 +113,9 @@ Rows: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" - dsdLink: "https://www.ilo.org/sdmx/rest/datastructure/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" - metadataLink: "https://www.ilo.org/sdmx/rest/dataflow/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" - DATA: "https://www.ilo.org/sdmx/rest/data/DF_SDG_0852_SEX_AGE_RT/X01+X04+X02+X03.A.SDG_0852_RT.SEX_T.AGE_YTHADULT_Y15-24" + dsdLink: "https://sdmx.ilo.org/rest/datastructure/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" + metadataLink: "https://sdmx.ilo.org/rest/dataflow/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" + DATA: "https://sdmx.ilo.org/rest/data/DF_SDG_0852_SEX_AGE_RT/X01+X04+X02+X03.A.SDG_0852_RT.SEX_T.AGE_YTHADULT_Y15-24" - Row: 3 chartType: LINE @@ -130,6 +130,6 @@ Rows: xAxisConcept: TIME_PERIOD yAxisConcept: OBS_VALUE downloadYN: "Yes" - dsdLink: "https://www.ilo.org/sdmx/rest/datastructure/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" - metadataLink: "https://www.ilo.org/sdmx/rest/dataflow/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" - DATA: https://www.ilo.org/sdmx/rest/data/DF_SDG_0852_SEX_AGE_RT/X01.A.SDG_0852_RT.SEX_T.AGE_YTHADULT_Y15-24 \ No newline at end of file + dsdLink: "https://sdmx.ilo.org/rest/datastructure/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" + metadataLink: "https://sdmx.ilo.org/rest/dataflow/ILO/DF_SDG_0852_SEX_AGE_RT/1.0?detail=full" + DATA: https://sdmx.ilo.org/rest/data/DF_SDG_0852_SEX_AGE_RT/X01.A.SDG_0852_RT.SEX_T.AGE_YTHADULT_Y15-24 \ No newline at end of file