feat: support picosecond precision in BigQueryTimestamp#1591
feat: support picosecond precision in BigQueryTimestamp#1591google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
This change updates the `BigQueryTimestamp` class to correctly handle ISO 8601 timestamp strings with precision greater than nanoseconds (e.g., picoseconds). Previously, `BigQueryTimestamp` relied on `PreciseDate`, which truncates fractional seconds beyond 9 digits. This implementation detects high-precision strings (more than 9 fractional digits), validates them by checking a truncated version against `PreciseDate`, and if valid, preserves the original string value. This ensures that picosecond precision is not lost when sending query parameters to BigQuery. Added tests to verify: - Preservation of picosecond precision. - Preservation of nanosecond precision (no regression). - Handling of invalid high-precision timestamps.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Implemented support for ISO 8601 timestamps with precision greater than nanoseconds (up to picoseconds) in
BigQueryTimestamp. This mirrors functionality recently added to the BigQuery Java client. The implementation validates the high-precision timestamp by truncating it to nanoseconds and checking validity withPreciseDate, then stores the original string to preserve precision. Added comprehensive tests intest/bigquery.ts.PR created automatically by Jules for task 194624622912275634 started by @danieljbruce