Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support RANGE query parameters #1827

Merged
merged 14 commits into from
Mar 4, 2024
Prev Previous commit
Next Next commit
system test
  • Loading branch information
Linchin committed Feb 24, 2024
commit 36529b5e4ed58f28b1711999b8b795f27bf829ec
27 changes: 24 additions & 3 deletions tests/system/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,16 +425,37 @@ def test_query_statistics(bigquery_client, query_api_method):
],
),
(
"SELECT @date_range",
datetime.date(2016, 12, 5),
"SELECT @range_date",
"[2016-12-05, UNBOUNDED)",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is 'UNBOUNDED' some kind of type alias, or does the service return that as the literal string? If so, should we convert UNBOUNDED -> None when build query parameter values?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The service returns 'UNBOUNDED' as part of the literal string. 'UNBOUNDED' isn't an alias of any type, so it's safe to convert it into None.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! Its fine to punt on this aspect, I just wanted to clarify.

[
RangeQueryParameter(
name="date_range",
name="range_date",
range_element_type="DATE",
start=datetime.date(2016, 12, 5),
)
],
),
(
"SELECT @range_datetime",
"[2016-12-05T12:00:00.000000, UNBOUNDED)",
[
RangeQueryParameter(
name="range_datetime",
range_element_type="DATETIME",
start=datetime.datetime(2016, 12, 5),
)
],
),
(
"SELECT @range_unbounded",
"[UNBOUNDED, UNBOUNDED)",
[
RangeQueryParameter(
name="range_unbounded",
range_element_type="DATETIME",
)
],
),
),
)
def test_query_parameters(
Expand Down