Commit 064c9486 authored by Christophe Benz's avatar Christophe Benz
Browse files

Merge branch 'issue_972-url_encode_series_codes' into 'master'

Fix #972: Python client: '+' in series codes is interpreted as spaces by API

See merge request !8
parents c83e8126 ff8f1da5
Pipeline #243784 passed with stage
in 44 seconds
...@@ -25,6 +25,7 @@ import itertools ...@@ -25,6 +25,7 @@ import itertools
import json import json
import logging import logging
import os import os
import urllib
from collections import defaultdict from collections import defaultdict
from urllib.parse import urljoin from urllib.parse import urljoin
...@@ -188,7 +189,9 @@ def fetch_series( ...@@ -188,7 +189,9 @@ def fetch_series(
if series_ids is not None: if series_ids is not None:
if provider_code or dataset_code: if provider_code or dataset_code:
raise ValueError("When you use `series_ids`, you must not specifiy `provider_code` nor `dataset_code`.") raise ValueError("When you use `series_ids`, you must not specifiy `provider_code` nor `dataset_code`.")
api_link = series_base_url + "?observations=1&series_ids={}".format(",".join(series_ids)) api_link = series_base_url + "?observations=1&series_ids={}".format(
",".join(map(urllib.parse.quote, series_ids))
)
return fetch_series_by_api_link( return fetch_series_by_api_link(
api_link, api_link,
filters=filters, filters=filters,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment