Skip to content

Commit 32929aa

Browse files
committed
[SEA-NodeJS] prettier-format SEA connection/options + async files (CI code-style)
The CI "Check code style" step runs `prettier . --check` (whole repo); these files were committed without prettier formatting. Formatting-only. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
1 parent ef486b7 commit 32929aa

4 files changed

Lines changed: 5 additions & 15 deletions

File tree

lib/sea/SeaAuth.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,7 @@ export function buildSeaConnectionOptions(options: ConnectionOptions): SeaNative
296296
const { maxConnections } = options as { maxConnections?: number };
297297
if (maxConnections !== undefined) {
298298
if (!Number.isInteger(maxConnections) || maxConnections < 1) {
299-
throw new HiveDriverError(
300-
`SEA backend: \`maxConnections\` must be a positive integer; got ${maxConnections}.`,
301-
);
299+
throw new HiveDriverError(`SEA backend: \`maxConnections\` must be a positive integer; got ${maxConnections}.`);
302300
}
303301
if (maxConnections > MAX_U32) {
304302
throw new HiveDriverError(

lib/sea/SeaOperationBackend.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ export default class SeaOperationBackend implements IOperationBackend {
156156

157157
constructor({ asyncStatement, statement, context, id }: SeaOperationBackendOptions) {
158158
if ((asyncStatement === undefined) === (statement === undefined)) {
159-
throw new HiveDriverError(
160-
'SeaOperationBackend: exactly one of `asyncStatement` or `statement` must be provided',
161-
);
159+
throw new HiveDriverError('SeaOperationBackend: exactly one of `asyncStatement` or `statement` must be provided');
162160
}
163161
this.asyncStatement = asyncStatement;
164162
this.blockingStatement = statement;

tests/unit/sea/connectionOptions.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const PAT = { host: 'h.databricks.com', path: '/sql/1.0/warehouses/abc', token:
2121

2222
// Cast helper: the SEA connection-tuning/TLS options live on the internal
2323
// surface, so tests build untyped option literals.
24-
const opts = (extra: Record<string, unknown>) => ({ ...PAT, ...extra }) as unknown as ConnectionOptions;
24+
const opts = (extra: Record<string, unknown>) => ({ ...PAT, ...extra } as unknown as ConnectionOptions);
2525

2626
describe('SeaAuth connection options — intervalsAsString default', () => {
2727
it('always sets intervalsAsString:true (thrift-compatible interval rendering)', () => {
@@ -90,10 +90,7 @@ describe('SeaAuth TLS options (buildSeaTlsOptions)', () => {
9090
});
9191

9292
it('rejects a non-PEM string', () => {
93-
expect(() => buildSeaTlsOptions(opts({ customCaCert: 'not-a-pem' }))).to.throw(
94-
HiveDriverError,
95-
/PEM certificate/,
96-
);
93+
expect(() => buildSeaTlsOptions(opts({ customCaCert: 'not-a-pem' }))).to.throw(HiveDriverError, /PEM certificate/);
9794
});
9895

9996
it('rejects an empty Buffer', () => {

tests/unit/sea/execution.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -740,10 +740,7 @@ describe('SeaOperationBackend — async (submitStatement) path', () => {
740740

741741
it('rejects when neither asyncStatement nor statement is provided', () => {
742742
// eslint-disable-next-line @typescript-eslint/no-explicit-any
743-
expect(() => new SeaOperationBackend({ context: makeContext() } as any)).to.throw(
744-
HiveDriverError,
745-
/exactly one/,
746-
);
743+
expect(() => new SeaOperationBackend({ context: makeContext() } as any)).to.throw(HiveDriverError, /exactly one/);
747744
});
748745

749746
it('rejects when BOTH asyncStatement and statement are provided', () => {

0 commit comments

Comments
 (0)