Skip to content

Commit 430f7f5

Browse files
committed
Refactor for API changes in Metabase v48
1 parent 38ba30c commit 430f7f5

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.3.2
2+
### Changed
3+
- Refactored for API changes introduced in Metabase v48 (`ordered_cards` -> `dashcards`)
4+
5+
## 0.3.1
6+
### Changed
7+
- Fixed a typo in create_card function (PR [#47](https://github.com/vvaezian/metabase_api_python/pull/47))
8+
19
## 0.3.0
210
### Changed
311
- Option for local unittest is added. Also GitHub Actions Workflow is modified to use local testing.

metabase_api/copy_methods.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ def copy_dashboard(self, source_dashboard_name=None, source_dashboard_id=None,
173173
cards_collection_id = res['id']
174174

175175
# duplicate cards and put them in the created collection and make a card_id mapping
176-
source_dashboard_card_IDs = [ i['card_id'] for i in source_dashboard['ordered_cards'] if i['card_id'] is not None ]
176+
source_dashboard_card_IDs = [ i['card_id'] for i in source_dashboard['dashcards'] if i['card_id'] is not None ]
177177
card_id_mapping = {}
178178
for card_id in source_dashboard_card_IDs:
179179
dup_card_id = self.copy_card(source_card_id=card_id, destination_collection_id=cards_collection_id)
180180
card_id_mapping[card_id] = dup_card_id
181181

182182
# replace cards in the duplicated dashboard with duplicated cards
183183
dup_dashboard = self.get('/api/dashboard/{}'.format(dup_dashboard_id))
184-
for card in dup_dashboard['ordered_cards']:
184+
for card in dup_dashboard['dashcards']:
185185

186186
# ignore text boxes. These get copied in the shallow-copy stage.
187187
if card['card_id'] is None:

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="0.3.1",
8+
version="0.3.2",
99
author="Vahid Vaezian",
1010
author_email="vahid.vaezian@gmail.com",
1111
description="A Python Wrapper for Metabase API",

0 commit comments

Comments
 (0)