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

Couldn't get dashboards from API #28157

Open
3 tasks done
tinolyuu opened this issue Apr 20, 2024 · 0 comments
Open
3 tasks done

Couldn't get dashboards from API #28157

tinolyuu opened this issue Apr 20, 2024 · 0 comments

Comments

@tinolyuu
Copy link

Bug description

We are using Google OAuth and I created a api user using superset fab to use superset API.

client = SupersetClient(
    host=<url>,
    username="api-user",
    password=<password>,
)

dashboards = client.dashboards.find()

And it returns 0 dashboards.
I also tried another way as following:

login_response = requests.post(
    "<url>/login",
    None,
    {
        "username": "api-user",
        "password": <password>,
        "refresh": True,
        "provider": "db",
    },
)
access_token = login_response.json()["access_token"]
session = requests.Session()
session.headers.update(
    {
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json",
        "Accept": "*/*",
    }
)
current_dashboard_page = 0
total_dashboards = PAGE_SIZE
while current_dashboard_page * PAGE_SIZE <= total_dashboards:
    dashboard_response = session.get(
        f"<url>/api/v1/dashboard/",
        params=f"q=(page:{current_dashboard_page},page_size:{PAGE_SIZE})",
    )

And it also returns 0 dashboard.

How to reproduce the bug

As description.

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

Superset version: 3.0.3

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
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

1 participant