Skip to content

Commit b19cd25

Browse files
committed
Merge branch 'm-kovalsky/pbir'
2 parents 6ba930d + 52800c5 commit b19cd25

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/sempy_labs/report/_reportwrapper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ def __init__(
9999
self._readonly = readonly
100100
self._show_diffs = show_diffs
101101

102+
# Check that the report is in the PBIR format.
103+
response = _base_api(request=f"/v1.0/myorg/groups/{self._workspace_id}/reports/{self._report_id}", client="fabric_sp")
104+
self.format = response.json().get('format')
105+
102106
result = _base_api(
103107
request=f"/v1/workspaces/{self._workspace_id}/items/{self._report_id}/getDefinition",
104108
method="post",
@@ -111,10 +115,6 @@ def __init__(
111115

112116
# Check that the report is in the PBIR format
113117
parts = result.get("definition", {}).get("parts", [])
114-
if self._report_file_path not in [p.get("path") for p in parts]:
115-
self.format = "PBIR-Legacy"
116-
else:
117-
self.format = "PBIR"
118118
self._report_definition = {"parts": []}
119119
for part in parts:
120120
path = part.get("path")

0 commit comments

Comments
 (0)