Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .changeset/fine-cameras-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wrangler": major
---

minor: R2 data catalog URIs now separate account ID and warehouse name with a slash rather than an underscore
12 changes: 6 additions & 6 deletions packages/wrangler/src/__tests__/r2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ describe("r2", () => {
createFetchResult(
{
id: "test-warehouse-id",
name: "test-warehouse-name",
name: "test-account-id_test-warehouse-name",
},
true
)
Expand All @@ -986,8 +986,8 @@ describe("r2", () => {
expect(std.out).toMatchInlineSnapshot(
`"✨ Successfully enabled data catalog on bucket 'testBucket'.

Catalog URI: 'https://catalog.cloudflarestorage.com/test-warehouse-name'
Warehouse: 'test-warehouse-name'
Catalog URI: 'https://catalog.cloudflarestorage.com/test-account-id/test-warehouse-name'
Warehouse: 'test-account-id_test-warehouse-name'

Use this Catalog URI with Iceberg-compatible query engines (Spark, PyIceberg etc.) to query data as tables.
Note: You will need a Cloudflare API token with 'R2 Data Catalog' permission to authenticate your client with this catalog.
Expand Down Expand Up @@ -1157,7 +1157,7 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/"
createFetchResult(
{
id: "test-id",
name: "test-name",
name: "test-account-id_test-name",
bucket: "test-bucket",
status: "active",
},
Expand All @@ -1172,8 +1172,8 @@ For more details, refer to: https://developers.cloudflare.com/r2/api/s3/tokens/"
expect(std.out).toMatchInlineSnapshot(`
"Getting data catalog status for 'test-bucket'...

Catalog URI: https://catalog.cloudflarestorage.com/test-name
Warehouse: test-name
Catalog URI: https://catalog.cloudflarestorage.com/test-account-id/test-name
Warehouse: test-account-id_test-name
Status: active"
`);
});
Expand Down
10 changes: 6 additions & 4 deletions packages/wrangler/src/r2/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ export const r2BucketCatalogEnableCommand = createCommand({

let catalogHost: string;
const env = getCloudflareApiEnvironmentFromEnv();
const path = response.name.replace("_", "/");
if (env === "staging") {
catalogHost = `https://catalog-staging.cloudflarestorage.com/${response.name}`;
catalogHost = `https://catalog-staging.cloudflarestorage.com/${path}`;
} else {
catalogHost = `https://catalog.cloudflarestorage.com/${response.name}`;
catalogHost = `https://catalog.cloudflarestorage.com/${path}`;
}

logger.log(
Expand Down Expand Up @@ -125,10 +126,11 @@ export const r2BucketCatalogGetCommand = createCommand({

const env = getCloudflareApiEnvironmentFromEnv();
let catalogHost: string;
const path = catalog.name.replace("_", "/");
if (env === "staging") {
catalogHost = `https://catalog-staging.cloudflarestorage.com/${catalog.name}`;
catalogHost = `https://catalog-staging.cloudflarestorage.com/${path}`;
} else {
catalogHost = `https://catalog.cloudflarestorage.com/${catalog.name}`;
catalogHost = `https://catalog.cloudflarestorage.com/${path}`;
}

const output = {
Expand Down