Repository navigation
fix(bigquery): preserve timestamp nanoseconds when microseconds are zero - #9650
danieljbruce wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the BigQueryTimestamp class to preserve nanosecond precision when converting to an ISO string, even if the microsecond precision is zero. A corresponding unit test has been added to verify this behavior. There are no review comments, so no additional feedback is provided.
… style guidelines
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the BigQueryTimestamp class to preserve nanosecond precision when microseconds are zero. It also refines the JSDoc and TypeScript type definitions for the timestamp methods to explicitly return BigQueryTimestamp, and adds comprehensive unit tests to verify the preservation of nanoseconds under various conditions. There are no review comments to address.
Description
This pull request preserves nanosecond precision when timestamp microseconds equal zero.
Impact
Queries with
BigQueryTimestampparameters no longer lose sub-microsecond nanosecond precision.Changes
BigQueryTimestampconstructor inhandwritten/bigquery/src/bigquery.tsto checkpd.getMicroseconds() > 0 || pd.getNanoseconds() > 0before serializing withpd.toISOString().Testing
handwritten/bigquery/test/bigquery.tsverifying thatbq.timestamp()preserves nanosecond precision when microseconds are0for bothPreciseDateand ISO string inputs.Alternatives
BigQueryTimestampdropping nanosecond precision whenever the microsecond component happens to be zero (000), while merging carries negligible risk because timestamps without microseconds or nanoseconds continue usingDate#toJSON().