vvaezian / metabase_api_python

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

feat(clone_methods): collection, dashboard and card #52

Open lucmerceron opened 3 months ago

lucmerceron commented 3 months ago

Hello,

This MR encapsulates a bunch of scripts that we use at our company when we want to clone a collection and its components (dashboards / cards) while changing the targeted database of the cards to another one. This is useful when we have a new client and we need to instantiate a template collection for its database or when we need to duplicate a collection to do some tests without putting noise into the original one.

I couldn't properly create tests for the functions. Related to https://github.com/vvaezian/metabase_api_python/issues/18 & https://github.com/vvaezian/metabase_api_python/issues/32

Regards

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 3.75000% with 154 lines in your changes are missing coverage. Please review.

Project coverage is 51.88%. Comparing base (607f5b8) to head (3cd752e). Report is 6 commits behind head on master.

:exclamation: Current head 3cd752e differs from pull request most recent head 9c1140e

Please upload reports for the commit 9c1140e to get more accurate results.

Files Patch % Lines
metabase_api/clone_methods.py 2.68% 145 Missing :warning:
metabase_api/_helper_methods.py 10.00% 9 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #52 +/- ## =========================================== - Coverage 62.39% 51.88% -10.51% =========================================== Files 7 8 +1 Lines 734 900 +166 =========================================== + Hits 458 467 +9 - Misses 276 433 +157 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

vvaezian commented 3 months ago

Hi @lucmerceron, thanks for the PR. I'll review it soon.

lucmerceron commented 3 months ago

Thanks @vvaezian, tell me if I can be of any help

vvaezian commented 3 months ago

@lucmerceron If you can create some unittests that would be great. There is a sqlite DB in tests/data. You can duplicate that with a different name and use it as the target db. You can use https://sqliteviewer.flowsoft7.com/ to view the content of sqlite DBs. Instructions for unittesting is available in the tests dir.