Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database.getDatabaseDialect's "cb" argument is never used #2075

Closed
odeke-em opened this issue Jul 5, 2024 · 1 comment · Fixed by #2078
Closed

Database.getDatabaseDialect's "cb" argument is never used #2075

odeke-em opened this issue Jul 5, 2024 · 1 comment · Fixed by #2078
Assignees
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API.

Comments

@odeke-em
Copy link

odeke-em commented Jul 5, 2024

If we examine the method "getDatabaseDialect"

nodejs-spanner/src/database.ts

Lines 1530 to 1553 in 30151ca

getDatabaseDialect(
options: CallOptions,
callback: GetDatabaseDialectCallback
): void;
async getDatabaseDialect(
optionsOrCallback?: CallOptions | GetDatabaseDialectCallback,
cb?: GetDatabaseDialectCallback
): Promise<
| EnumKey<typeof databaseAdmin.spanner.admin.database.v1.DatabaseDialect>
| undefined
> {
const gaxOptions =
typeof optionsOrCallback === 'object' ? optionsOrCallback : {};
if (
this.databaseDialect === 'DATABASE_DIALECT_UNSPECIFIED' ||
this.databaseDialect === null ||
this.databaseDialect === undefined
) {
const [metadata] = await this.getMetadata(gaxOptions);
this.databaseDialect = metadata.databaseDialect;
}
return this.databaseDialect || undefined;
}

we can see that the callback passed in is never used. I found this while working on trace instrumentation for these libraries.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/nodejs-spanner API. label Jul 5, 2024
@alkatrivedi
Copy link
Contributor

Hi @odeke-em, thanks for pointing it out. I have raised a PR to fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants