@microsoft/rayfin-connector-fabric-semanticmodel 1.36.0-alpha.1620 → 1.36.0-alpha.1663
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.
- package/dist/arrow.js +23 -2
- package/package.json +2 -2
package/dist/arrow.js
CHANGED
|
@@ -154,6 +154,18 @@ function isArrowErrorTable(columnNames) {
|
|
|
154
154
|
const nameSet = new Set(columnNames);
|
|
155
155
|
return REQUIRED_ERROR_COLUMNS.every((col) => nameSet.has(col));
|
|
156
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Coerce a raw Arrow diagnostic cell to a string, returning `undefined` when it
|
|
159
|
+
* is null/undefined or coerces to the empty string. Used for the optional
|
|
160
|
+
* `code`/`details` fields so a blank `ErrorCode`/`ErrorDescription` is omitted
|
|
161
|
+
* rather than surfaced as an empty diagnostic.
|
|
162
|
+
*/
|
|
163
|
+
function nonEmptyDiagnostic(raw) {
|
|
164
|
+
if (raw == null)
|
|
165
|
+
return undefined;
|
|
166
|
+
const value = String(raw);
|
|
167
|
+
return value.length > 0 ? value : undefined;
|
|
168
|
+
}
|
|
157
169
|
/**
|
|
158
170
|
* Decode an Apache Arrow IPC stream into a
|
|
159
171
|
* {@link FabricSemanticModelTabularResponse}.
|
|
@@ -186,13 +198,22 @@ export function parseArrowStream(bytes, requestId = '') {
|
|
|
186
198
|
if (isArrowErrorTable(columnNames)) {
|
|
187
199
|
const firstRow = arrowTable.get(0);
|
|
188
200
|
const rowJson = (firstRow?.toJSON?.() ?? {});
|
|
189
|
-
|
|
201
|
+
// `||` (not `??`) so an empty `ErrorMessage` also falls back to the generic
|
|
202
|
+
// message. `code`/`details` are coerced and dropped when empty so a blank
|
|
203
|
+
// diagnostic is omitted rather than rendered as `code: ''`/`details: ''`.
|
|
204
|
+
const message = String(rowJson['ErrorMessage'] || 'Unknown DAX error');
|
|
205
|
+
const code = nonEmptyDiagnostic(rowJson['ErrorCode']);
|
|
206
|
+
const details = nonEmptyDiagnostic(rowJson['ErrorDescription']);
|
|
190
207
|
return {
|
|
191
208
|
status: 'Succeeded',
|
|
192
209
|
output: {
|
|
193
210
|
tables: [],
|
|
194
211
|
requestId,
|
|
195
|
-
queryError: {
|
|
212
|
+
queryError: {
|
|
213
|
+
message,
|
|
214
|
+
...(code !== undefined ? { code } : {}),
|
|
215
|
+
...(details !== undefined ? { details } : {}),
|
|
216
|
+
},
|
|
196
217
|
},
|
|
197
218
|
errors: [],
|
|
198
219
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/rayfin-connector-fabric-semanticmodel",
|
|
3
|
-
"version": "1.36.0-alpha.
|
|
3
|
+
"version": "1.36.0-alpha.1663",
|
|
4
4
|
"description": "Typed connector marker for the Fabric semantic-model (Power BI dataset) connector category. Pair with @microsoft/rayfin-client to type `client.connectors.<name>.executeQuery(...)`.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"apache-arrow": "^21.1.0",
|
|
30
30
|
"lz4js": "^0.2.0",
|
|
31
|
-
"@microsoft/rayfin-connectors": "1.36.0-alpha.
|
|
31
|
+
"@microsoft/rayfin-connectors": "1.36.0-alpha.1663"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"registry": "https://npm.pkg.github.com",
|