Skip to content

Commit 8a2d260

Browse files
committed
improve error message for copy_dashboard
1 parent fca638c commit 8a2d260

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/*.ipynb
2+
**/__pycache__/

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 3.4.5
1+
## 3.4.5.1
22
### Changed
33
- Fix [#59](https://github.com/vvaezian/metabase_api_python/issues/59)
44
- Improve docs styling

metabase_api/copy_methods.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,10 @@ def copy_dashboard(self, source_dashboard_name=None, source_dashboard_id=None,
162162
'collection_position': collection_position,
163163
'description': description
164164
}
165-
res = self.post('/api/dashboard/{}/copy'.format(source_dashboard_id), json=parameters)
166-
dup_dashboard_id = res['id']
167-
165+
res = self.post('/api/dashboard/{}/copy'.format(source_dashboard_id), 'raw', json=parameters)
166+
if res.status_code != 200:
167+
raise ValueError('Error copying the dashboard: {}'.format(res.text))
168+
dup_dashboard_id = res.json()['id']
168169
return dup_dashboard_id
169170

170171

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="metabase-api",
8-
version="3.4.5",
8+
version="3.4.5.1",
99
author="Vahid Vaezian",
1010
author_email="[email protected]",
1111
description="A Python Wrapper for Metabase API",

0 commit comments

Comments
 (0)