Skip to content

test(csharp): cover production-shaped warehouse path in fast-metadata + org-id parsing - #564

Open
jadewang-db wants to merge 1 commit into
mainfrom
test/warehouse-path-fast-metadata-orgid
Open

test(csharp): cover production-shaped warehouse path in fast-metadata + org-id parsing#564
jadewang-db wants to merge 1 commit into
mainfrom
test/warehouse-path-fast-metadata-orgid

Conversation

@jadewang-db

Copy link
Copy Markdown
Collaborator

What

Adds test cases that pin the real-world SQL warehouse path shape — /sql/1.0/warehouses/{16-char-hex}?o={numeric-org-id} — to the warehouse-classification and org-id parsing tests. Existing tests only exercised placeholder ids (abc123 / 987654).

  • DatabricksConnectionUnitTests.IsWarehousePath_WarehousePaths_ReturnsTrue: adds /sql/1.0/warehouses/8d1707669a5ea9e2?o=6051921418418893, asserting the fast-metadata warehouse classification strips the ?o= query string and matches the warehouse regex.
  • StatementExecutionConnectionOrgIdTests.Constructor_RealWorldWarehousePathWithOrgId_ExtractsWarehouseIdAndOrgId: asserts the SEA path extracts both warehouse id (8d1707669a5ea9e2) and org id (6051921418418893) from the same path shape.

Why

Verifying a question about whether the fast-metadata path correctly detects the warehouse type for a production path like /sql/1.0/warehouses/8d1707669a5ea9e2?o=6051921418418893. Both the Thrift path (DatabricksConnection.IsWarehousePath) and the SEA path (StatementExecutionConnection) already strip the query string before regex matching and handle this correctly — these tests lock in the concrete production-shaped case so it can't regress.

Test

Both new cases run and pass:

Passed  ...IsWarehousePath_WarehousePaths_ReturnsTrue(path: "/sql/1.0/warehouses/8d1707669a5ea9e2?o=6051921418418893")
Passed  ...Constructor_RealWorldWarehousePathWithOrgId_ExtractsWarehouseIdAndOrgId

Tests only — no production code change.

This pull request and its description were written by Isaac.

… + org-id parsing

Add test cases pinning the real-world warehouse path shape
(/sql/1.0/warehouses/{16-char-hex}?o={numeric-org-id}) that existing
tests only exercised with placeholder ids like abc123/987654:

- IsWarehousePath_WarehousePaths_ReturnsTrue: assert the fast-metadata
  warehouse classification strips the ?o= query string and matches.
- StatementExecutionConnectionOrgIdTests: assert the SEA path extracts
  both warehouse id and org id from the same path shape.

Both paths already handled this correctly; these lock in the concrete case.

Co-authored-by: Isaac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant