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

fix: untyped string array type #2011

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

surbhigarg92
Copy link
Contributor

Fixes #2009

@surbhigarg92 surbhigarg92 requested review from a team as code owners March 4, 2024 09:16
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Mar 4, 2024
@surbhigarg92 surbhigarg92 changed the title Untyped string array fix: untyped string array type Mar 4, 2024
@@ -629,6 +630,10 @@ function getType(value: Value): Type {
return {type: 'bool'};
}

if (is.string(value) && isArrayValue) {
return {type: 'string'};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this. Why are we returning type: 'string' if the value is an array and a string? What happens now if the value is a string, but not an array? Then the return type will be unspecified, right? While it now is string.

And why do we want to return type: 'string' for array values, and not array<string>?

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. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INVALID_ARGUMENT: The code field is required for types.
2 participants