Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dbnomics
dbnomics-python-client
Commits
8e244d0b
Commit
8e244d0b
authored
Sep 04, 2019
by
Bruno Duyé
Committed by
Bruno Duyé
Sep 04, 2019
Browse files
Fix: dbnomics.api_base_url ignored
parent
a7efb003
Pipeline
#85402
passed with stage
in 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
8e244d0b
...
...
@@ -38,7 +38,7 @@ dataframe = fetch_series(
)
```
Or
set
the default API URL
by
[
monkey-patching
](
https://en.wikipedia.org/wiki/Monkey_patch
)
the
`dbnomics`
module, like this:
Or
globally change
the default API URL
used by
the
`dbnomics`
module, like this:
```
python
import
dbnomics
...
...
dbnomics/__init__.py
View file @
8e244d0b
...
...
@@ -62,7 +62,7 @@ class TooManySeries(Exception):
def
fetch_series
(
provider_code
=
None
,
dataset_code
=
None
,
series_code
=
None
,
dimensions
=
None
,
series_ids
=
None
,
max_nb_series
=
None
,
api_base_url
=
default_api_base_url
,
max_nb_series
=
None
,
api_base_url
=
None
,
editor_api_base_url
=
default_editor_api_base_url
,
filters
=
None
):
"""Download time series from DBnomics. Filter series by different ways according to the given parameters.
...
...
@@ -108,6 +108,9 @@ def fetch_series(provider_code=None, dataset_code=None, series_code=None, dimens
fetch_series('AMECO/ZUTN/EA19.1.0.0.0.ZUTN', filters=[{"code": "interpolate", "parameters": {"frequency": "monthly", "method": "spline"}}])
"""
# Parameters validation
global
default_api_base_url
if
api_base_url
is
None
:
api_base_url
=
default_api_base_url
if
not
api_base_url
.
endswith
(
'/'
):
api_base_url
+=
"/"
if
dataset_code
is
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment