duckrun 0.2.9.dev4__tar.gz → 0.2.9.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/PKG-INFO +1 -1
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/__init__.py +1 -1
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/semantic_model.py +36 -29
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun.egg-info/PKG-INFO +1 -1
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/pyproject.toml +1 -1
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/LICENSE +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/README.md +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/auth.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/core.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/files.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/lakehouse.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/runner.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/stats.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun/writer.py +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun.egg-info/SOURCES.txt +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun.egg-info/dependency_links.txt +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun.egg-info/requires.txt +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/duckrun.egg-info/top_level.txt +0 -0
- {duckrun-0.2.9.dev4 → duckrun-0.2.9.dev5}/setup.cfg +0 -0
@@ -130,7 +130,7 @@ def check_dataset_exists(dataset_name, workspace_id, client):
|
|
130
130
|
|
131
131
|
|
132
132
|
def refresh_dataset(dataset_name, workspace_id, client, dataset_id=None):
|
133
|
-
"""Refresh a dataset and monitor progress"""
|
133
|
+
"""Refresh a dataset and monitor progress using Power BI API"""
|
134
134
|
|
135
135
|
# If dataset_id not provided, look it up by name
|
136
136
|
if not dataset_id:
|
@@ -144,39 +144,46 @@ def refresh_dataset(dataset_name, workspace_id, client, dataset_id=None):
|
|
144
144
|
"objects": []
|
145
145
|
}
|
146
146
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
147
|
+
# Use Power BI API for refresh (not Fabric API)
|
148
|
+
powerbi_url = f"https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/refreshes"
|
149
|
+
headers = client._get_headers()
|
150
|
+
|
151
|
+
response = requests.post(powerbi_url, headers=headers, json=payload)
|
151
152
|
|
152
153
|
if response.status_code in [200, 202]:
|
153
154
|
print(f"✓ Refresh initiated")
|
154
155
|
|
155
|
-
refresh_id
|
156
|
-
if
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
156
|
+
# For 202, get the refresh_id from the Location header
|
157
|
+
if response.status_code == 202:
|
158
|
+
location = response.headers.get('Location')
|
159
|
+
if location:
|
160
|
+
refresh_id = location.split('/')[-1]
|
161
|
+
print(" Monitoring refresh progress...")
|
162
|
+
max_attempts = 60
|
163
|
+
for attempt in range(max_attempts):
|
164
|
+
time.sleep(5)
|
165
|
+
|
166
|
+
# Check refresh status using Power BI API
|
167
|
+
status_url = f"https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/refreshes/{refresh_id}"
|
168
|
+
status_response = requests.get(status_url, headers=headers)
|
169
|
+
status_response.raise_for_status()
|
170
|
+
status = status_response.json().get('status')
|
171
|
+
|
172
|
+
if status == 'Completed':
|
173
|
+
print(f"✓ Refresh completed successfully")
|
174
|
+
return
|
175
|
+
elif status == 'Failed':
|
176
|
+
error = status_response.json().get('serviceExceptionJson', '')
|
177
|
+
raise Exception(f"Refresh failed: {error}")
|
178
|
+
elif status == 'Cancelled':
|
179
|
+
raise Exception("Refresh was cancelled")
|
180
|
+
|
181
|
+
if attempt % 6 == 0:
|
182
|
+
print(f" Status: {status}...")
|
166
183
|
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
elif status == 'Failed':
|
171
|
-
error = status_response.json().get('error', {})
|
172
|
-
raise Exception(f"Refresh failed: {error.get('message', 'Unknown error')}")
|
173
|
-
elif status == 'Cancelled':
|
174
|
-
raise Exception("Refresh was cancelled")
|
175
|
-
|
176
|
-
if attempt % 6 == 0:
|
177
|
-
print(f" Status: {status}...")
|
178
|
-
|
179
|
-
raise Exception(f"Refresh timed out")
|
184
|
+
raise Exception(f"Refresh timed out")
|
185
|
+
else:
|
186
|
+
response.raise_for_status()
|
180
187
|
|
181
188
|
|
182
189
|
def download_bim_from_github(url):
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|