Skip to content

Commit

Permalink
Added 'return_card' argument to the copy_card function.
Browse files Browse the repository at this point in the history
  • Loading branch information
vvaezian committed Jul 5, 2024
1 parent c9f450b commit 0356b0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.4.2
### Changed
- Added 'return_card' argument to the `copy_card` function.

## 3.4.1
### Changed
- PR #54 (fixes a typo in the `clone_card` function)
Expand Down
5 changes: 2 additions & 3 deletions metabase_api/copy_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def copy_card(self, source_card_name=None, source_card_id=None,
source_collection_name=None, source_collection_id=None,
destination_card_name=None,
destination_collection_name=None, destination_collection_id=None,
postfix='', verbose=False):
postfix='', verbose=False, return_card=False):
"""
Copy the card with the given name/id to the given destination collection.
Expand Down Expand Up @@ -55,8 +55,7 @@ def copy_card(self, source_card_name=None, source_card_id=None,
# Save as a new card
res = self.create_card(custom_json=card_json, verbose=verbose, return_card=True)

# Return the id of the created card
return res['id']
return res if return_card else res['id']



Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="metabase-api",
version="3.4.1",
version="3.4.2",
author="Vahid Vaezian",
author_email="vahid.vaezian@gmail.com",
description="A Python Wrapper for Metabase API",
Expand Down

0 comments on commit 0356b0c

Please sign in to comment.