Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
37bc23c
feat(appkit): migrate analytics to the modular @databricks/sdk-*
MarioCadenas Sep 1, 2026
94ebe11
chore: fixup
MarioCadenas Sep 14, 2026
7e80a2a
refactor(appkit): camelCase type-generator domain type; drop SDK resp…
MarioCadenas Sep 14, 2026
0064704
fix(appkit): point #540 never-crash mock at the modular warehouse API
MarioCadenas Sep 14, 2026
8604199
fix(appkit): declare modular @databricks/sdk-* packages as dependencies
MarioCadenas Sep 14, 2026
7b31252
fix(shared): resolve service-principal credentials from env in modula…
MarioCadenas Sep 14, 2026
1209120
chore(deps): sync pnpm-lock with appkit modular SDK dependencies
MarioCadenas Sep 14, 2026
3599b2f
fix(shared): preserve the @databricks/appkit User-Agent on modular cl…
MarioCadenas Sep 15, 2026
7466b81
docs(shared): point the legacy sql type note at resources/warehouse.ts
MarioCadenas Oct 7, 2026
2111d76
chore(deps): bump modular @databricks/sdk-* and re-create the attachm…
MarioCadenas Oct 7, 2026
ee9a37f
fix(shared): cache env-M2M OAuth tokens until shortly before expiry
MarioCadenas Oct 8, 2026
12db322
fix(appkit): read the modular SDK's httpStatusCode for OBO expiry and…
MarioCadenas Oct 14, 2026
85c7ec5
fix(shared): cache tokens for profile and default-chain auth
MarioCadenas Oct 15, 2026
58d0459
fix(shared): honor a profile's auth_type in the cached default chain
MarioCadenas Oct 16, 2026
db97339
fix(appkit): keep modular SDK API errors' status through the cache
MarioCadenas Oct 16, 2026
0990e36
fix(shared): restore legacy auth, retry and ApiError behavior on modu…
MarioCadenas Oct 16, 2026
db1d298
docs(shared): describe the workspace client facade as partly migrated
MarioCadenas Oct 16, 2026
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
7 changes: 2 additions & 5 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@
{
"patterns": [
{
"group": [
"@databricks/sdk-experimental",
"@databricks/sdk-experimental/**"
],
"message": "Import the Databricks SDK only through the wrapper in packages/shared/src/workspace-client. Add a re-export there if you need a new symbol."
"group": ["@databricks/sdk-*", "@databricks/sdk-*/**"],
"message": "Import the Databricks SDK only through the wrapper in packages/shared/src/workspace-client (legacy.ts for @databricks/sdk-experimental, modular.ts for the modular @databricks/sdk-* packages). Add a re-export there if you need a new symbol."
}
]
}
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/api/appkit/Interface.WorkspaceClient.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"packages/appkit": {
"ignoreDependencies": [
"vitest",
"@databricks/sdk-auth",
"@databricks/sdk-core",
"@databricks/sdk-experimental",
"@databricks/sdk-options",
"@databricks/sdk-statementexecution",
"@databricks/sdk-warehouses",
"@mlflow/core",
"autoevals"
]
Expand Down
5 changes: 5 additions & 0 deletions packages/appkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@
"dependencies": {
"@ast-grep/napi": "0.37.0",
"@databricks/lakebase": "workspace:*",
"@databricks/sdk-auth": "0.51.0",
"@databricks/sdk-core": "0.51.0",
"@databricks/sdk-experimental": "0.17.0",
"@databricks/sdk-options": "0.51.0",
"@databricks/sdk-statementexecution": "0.52.0",
"@databricks/sdk-warehouses": "0.53.0",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/api-logs": "0.219.0",
"@opentelemetry/auto-instrumentations-node": "0.77.0",
Expand Down
9 changes: 8 additions & 1 deletion packages/appkit/src/cache/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { createLakebasePool } from "../connectors/lakebase";
import { getClientOptions } from "../context/client-options";
import { getCurrentPrincipalKey } from "../context/execution-context";
import { AppKitError, ExecutionError, InitializationError } from "../errors";
import { httpStatusOf } from "../errors/http-status";
import { createLogger } from "../logging/logger";
import type { Counter, TelemetryProvider } from "../telemetry";
import { SpanStatusCode, TelemetryManager } from "../telemetry";
Expand Down Expand Up @@ -339,7 +340,13 @@ export class CacheManager {
if (sharedController.signal.aborted) {
throw error;
}
if (error instanceof AppKitError || error instanceof ApiError) {
// Keep any error that carries an HTTP status: the modular SDK's
// ApiError is a different class from the legacy one.
if (
error instanceof AppKitError ||
error instanceof ApiError ||
httpStatusOf(error) !== undefined
) {
throw error;
}
throw ExecutionError.statementFailed(
Expand Down
19 changes: 19 additions & 0 deletions packages/appkit/src/cache/tests/cache-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,25 @@ describe("CacheManager", () => {
);
});

test("should re-throw a modular SDK ApiError without wrapping (keeps its status)", async () => {
const { ModularApiError } = await import("shared/workspace-client");
const cache = await CacheManager.getInstance({
storage: createMockStorage(),
});
const body = new TextEncoder().encode(
JSON.stringify({
error_code: "INVALID_PARAMETER_VALUE",
message: "Run 1 does not exist.",
}),
);
const apiError = ModularApiError.fromHttpError(400, undefined, body);
const fn = vi.fn().mockRejectedValue(apiError);

await expect(cache.getOrExecute(["key"], fn, "user1")).rejects.toBe(
apiError,
);
});

test("should allow retry after error", async () => {
const cache = await CacheManager.getInstance({
storage: createMockStorage(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ export function parseDatabricksType(typeText: string): DataType {
export function buildEmptyArrowIPCBase64(
columns: Array<{
name?: string;
type_text?: string;
type_name?: string;
typeText?: string;
typeName?: string;
}>,
): string {
const fields = columns.map((col, index) => {
const typeText = col.type_text ?? col.type_name ?? "STRING";
const typeText = col.typeText ?? col.typeName ?? "STRING";
let dataType: DataType;
try {
dataType = parseDatabricksType(typeText);
Expand Down
Loading
Loading