vvaezian/metabase_api_python

Changing the database with the clone_card function

PatrickRoethlisberger opened this issue · 3 comments

I'd love to be able changing the underlying database with the clone_card function. The Use case I've got in mind is having multiple environments which all have the same question/card but different databases.

I've imagined something like this:

mb.clone_card(card_id=2, source_table_id=16, target_table_id=69, target_database_id=1 ,new_card_name='Cloned Card', new_card_collection_id=6, new_database_id=2, ignore_these_filters=[])

As far as I can tell, only the database_id as well as the dataset_query.database properties of the card have to be changed.

Hi @PatrickRoethlisberger, thanks for the feedback. I will work on this when I get some time. In the meantime please feel free to open a PR.

Hi @vvaezian I have a similar use case to the OP. Did you get a chance to work on this or is a PR still welcome?

Hi @rparrapy, not yet. Feel free to take a stab at it.