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

Fix #19726 - PBI test connection success with bad credentials #19730

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def get_auth_token(self) -> Tuple[str, str]:
auth_response = PowerBiToken(**response_data)
if not auth_response.access_token:
raise InvalidSourceException(
"Failed to generate the PowerBi access token. Please check provided config"
f"Failed to generate the PowerBi access token. Please check provided config {response_data}"
)

logger.info("PowerBi Access Token generated successfully")
Expand All @@ -105,19 +105,12 @@ def fetch_dashboards(self) -> Optional[List[PowerBIDashboard]]:
Returns:
List[PowerBIDashboard]
"""
try:
if self.config.useAdminApis:
response_data = self.client.get("/myorg/admin/dashboards")
response = DashboardsResponse(**response_data)
return response.value
group = self.fetch_all_workspaces()[0]
return self.fetch_all_org_dashboards(group_id=group.id)

except Exception as exc: # pylint: disable=broad-except
logger.debug(traceback.format_exc())
logger.warning(f"Error fetching dashboards: {exc}")

return None
if self.config.useAdminApis:
response_data = self.client.get("/myorg/admin/dashboards")
response = DashboardsResponse(**response_data)
return response.value
group = self.fetch_all_workspaces()[0]
return self.fetch_all_org_dashboards(group_id=group.id)

def fetch_all_org_dashboards(
self, group_id: str
Expand Down
Loading