Skip to content

Conversation

@surbhigarg92
Copy link
Contributor

@surbhigarg92 surbhigarg92 commented Jan 21, 2026

This PR reverts the recent change where UUID-formatted strings were implicitly treated as unspecified (untyped). That change caused regressions for customers relying on UUID-like strings being cast as STRING. This PR restores the default behavior: UUIDs will now default to STRING, ensuring stability for existing applications.

Impact on v8.4.0 Users This change affects users who adopted v8.4.0 and relied on the automatic UUID-to-untyped inference. To correctly send a UUID parameter, you must now explicitly specify the type:

javascript
const [rows1] = await database.run({
sql: "SELECT @value",
params: { value: '550e8400-e29b-41d4-a716-446655440000' },
types: {
value: "uuid" , // Explicitly specifying the type
},
});

Temporary Opt-in Flag To temporarily retain the behavior introduced in v8.4.0 (where UUIDs are treated as unspecified), customers can set the environment variable SPANNER_ENABLE_UUID_AS_UNTYPED=true.

Note: This flag causes a deprecation warning to be emitted and will be removed in a future release.
Recommendation: Customers are strongly encouraged to explicitly specify the type as 'uuid' instead of using this flag.

@surbhigarg92 surbhigarg92 requested review from a team as code owners January 21, 2026 08:29
@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 Jan 21, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @surbhigarg92, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses backward compatibility for UUID type handling by modifying how types are identified and assigned. It streamlines the type inference process in src/codec.ts by removing a specific UUID validation and simplifies type object creation in src/transaction.ts by eliminating conditional checks, ensuring broader compatibility for type assignments.

Highlights

  • UUID Type Handling: The explicit validation for UUID types returning an 'unspecified' type in the getType function within src/codec.ts has been removed. This change allows UUID values to be processed as strings, aligning with backward compatibility requirements.
  • Type Object Assignment Simplification: The conditional logic that previously filtered type object assignments based on TYPE_CODE_UNSPECIFIED in src/transaction.ts has been removed. The paramTypes are now assigned unconditionally, simplifying the type creation process.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a backward compatibility issue with UUID types. The change in src/codec.ts correctly adjusts the type inference for UUID strings, so they are now treated as string instead of unspecified. This is a good fix. The related change in src/transaction.ts simplifies parameter encoding by removing filtering for unspecified types, which is a nice cleanup.

My main feedback is that the change in src/codec.ts will likely break an existing unit test. Please see my specific comment for details on how to update the test to align with the new behavior.

I am having trouble creating individual review comments. Click here to see my feedback.

src/codec.ts (1163-1165)

high

This change correctly removes the special handling for UUIDs that was causing them to be inferred as unspecified. Now they will be correctly treated as strings, which fixes the backward compatibility issue.

However, this change will likely cause the test 'should determine if the uuid value is unspecified' in test/codec.ts to fail. Please update this test to reflect the new behavior, asserting that a UUID is now inferred as a string.

For example:

it('should determine if the uuid value is a string', () => {
  assert.deepStrictEqual(codec.getType(uuid.v4()), {
    type: 'string',
  });
});

@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Jan 22, 2026
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: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants