Skip to content

Commit 0356b0c

Browse files
committed
Added 'return_card' argument to the copy_card function.
1 parent c9f450b commit 0356b0c

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.4.2
2+
### Changed
3+
- Added 'return_card' argument to the `copy_card` function.
4+
15
## 3.4.1
26
### Changed
37
- PR #54 (fixes a typo in the `clone_card` function)

metabase_api/copy_methods.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def copy_card(self, source_card_name=None, source_card_id=None,
33
source_collection_name=None, source_collection_id=None,
44
destination_card_name=None,
55
destination_collection_name=None, destination_collection_id=None,
6-
postfix='', verbose=False):
6+
postfix='', verbose=False, return_card=False):
77
"""
88
Copy the card with the given name/id to the given destination collection.
99
@@ -55,8 +55,7 @@ def copy_card(self, source_card_name=None, source_card_id=None,
5555
# Save as a new card
5656
res = self.create_card(custom_json=card_json, verbose=verbose, return_card=True)
5757

58-
# Return the id of the created card
59-
return res['id']
58+
return res if return_card else res['id']
6059

6160

6261

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.1",
8+
version="3.4.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)