Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard tabs are not cloned #4

Open
CarlaTen opened this issue Nov 12, 2024 · 1 comment
Open

Dashboard tabs are not cloned #4

CarlaTen opened this issue Nov 12, 2024 · 1 comment

Comments

@CarlaTen
Copy link

Description

We implemented this code to duplicate a Metabase collection and change the data source.
The downloaded data fom Metabase (via API) includes the following structure:

  • collections
    • collection 1
      • collection 2
        • collection 3
          • cards
        • dashboards
  • snippets

The code successfully duplicates the following while changing the data source:

  • cards
  • the dashboard
  • the collections

However, it does not duplicate dashboard tabs.

Environment

Metabase Version: v1.50.32
Ruby Version: 3.3.6

Steps to reproduce

Create a collection in metabase with:

  1. A collection that stores queries using field filters
  2. A dashboard with tabs and filters

Expected behavior

After importing the duplicated collection to Metabase, both the original and the duplicated dashboards should contain all tabs, with queries functioning as expected.

Actual behavior

After importing, the original dashboard appears without tabs, and queries fail.

Problem

We suspect this issue arises because the duplicated dashboards (which have unique IDs) are internally referencing the same tabs, a configuration Metabase may not support.

Possible solution

The clone.rb script does not currently address tabs. Extending it to include tabs might resolve this issue.

@albertoperdomo
Copy link
Member

Hello @CarlaTen ,

this is just meant to be a prototype to demonstrate feasibility. I would not recommend using this in production and I am not surprised but there are edge cases that don't work. I tested this with x-rays and they don't have tabs.

You are welcome to use this code as guideline to create your own implementation. As an alternative, you could try looking at the yaml and the code and submit a patch that works. I would be happy to review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants