Skip to content

chore: add test of all supported BigQuery data types#17570

Open
tswast wants to merge 1 commit into
mainfrom
b527509188-fuzz
Open

chore: add test of all supported BigQuery data types#17570
tswast wants to merge 1 commit into
mainfrom
b527509188-fuzz

Conversation

@tswast

@tswast tswast commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This should be helpful in more thorough testing of the new compiler.

Towards b/527509188
🦕

This should be helpful in more thorough testing of the new compiler.

Towards b/527509188
@tswast tswast requested review from a team as code owners June 24, 2026 21:40
@tswast tswast requested review from sycai and removed request for a team June 24, 2026 21:40

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

Copy link
Copy Markdown
Contributor

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 expands the nested_structs test dataset and schema to include a wide variety of data types (such as boolean, integers, floats, JSON, dates, timestamps, geography, and decimals) and edge cases. It also updates the nested_structs_pandas_df fixture to manually parse these types and adds a comprehensive test suite to verify their behavior. Feedback was provided regarding a potential compatibility issue with datetime.datetime.fromisoformat parsing the trailing 'Z' suffix in Python versions older than 3.11.

Comment on lines +627 to +632
timestamp_vals = [
datetime.datetime.fromisoformat(get_val(row, "timestamp_col"))
if get_val(row, "timestamp_col") is not None
else None
for row in raw_rows
]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

In Python 3.10 and below, datetime.datetime.fromisoformat does not support the trailing Z suffix (which was introduced in Python 3.11). Since this library supports Python 3.9 and 3.10, parsing timestamp_col values ending in Z will raise a ValueError. Replacing Z with +00:00 ensures backward compatibility across all supported Python versions.

Suggested change
timestamp_vals = [
datetime.datetime.fromisoformat(get_val(row, "timestamp_col"))
if get_val(row, "timestamp_col") is not None
else None
for row in raw_rows
]
timestamp_vals = [
datetime.datetime.fromisoformat(get_val(row, "timestamp_col").replace("Z", "+00:00"))
if get_val(row, "timestamp_col") is not None
else None
for row in raw_rows
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant