Skip to content

Conversation

@danieljbruce
Copy link
Contributor

Summary:

While working on unit tests for the mutate function for Authorized Views we needed to determine the structure of the first argument passed into mutate. Currently the type of the first argument is Entry which is just an alias for any, but this is problematic because we can't expect any data structure for this argument. In fact, this method will only work properly if this argument is in a very specific format. Knowing this exact format is important when writing unit tests for mutate.

In this PR we add comments to the source code that describe the shape of the first mutate argument by describing the Entry data type and provide some tests that demonstrate how mutate and insert can be used.

Next steps:

In the future we may want to change the Entry type to be more specific so that users can only use mutate in the way it was intended to be used or else they will see a compiler error. This would be a breaking change though so it is a safer first step just to add some comments.

@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigtable Issues related to the googleapis/nodejs-bigtable API. labels Oct 4, 2024
@danieljbruce danieljbruce added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@danieljbruce danieljbruce added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@danieljbruce danieljbruce added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@danieljbruce danieljbruce marked this pull request as ready for review October 4, 2024 18:46
@danieljbruce danieljbruce requested review from a team as code owners October 4, 2024 18:46
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 4, 2024
@danieljbruce danieljbruce added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 4, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 4, 2024
@danieljbruce danieljbruce merged commit 86c8f4b into googleapis:main Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the googleapis/nodejs-bigtable API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants