vvaezian / metabase_api_python

A python wrapper for Metabase API
MIT License
131 stars 39 forks source link

Changing the database with the clone_card function #32

Open PatrickRoethlisberger opened 2 years ago

PatrickRoethlisberger commented 2 years ago

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.

vvaezian commented 2 years ago

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.

rparrapy commented 1 year ago

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?

vvaezian commented 1 year ago

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