Skip to content

Commit

Permalink
make sure JSON is callable
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast committed Mar 10, 2025
1 parent 7b225d7 commit df87a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion google/cloud/bigquery/_pyarrow_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def pyarrow_timestamp():
"GEOGRAPHY": pyarrow.string,
"INT64": pyarrow.int64,
"INTEGER": pyarrow.int64,
"JSON": json_arrow_type,
"JSON": lambda: json_arrow_type,
"NUMERIC": pyarrow_numeric,
"STRING": pyarrow.string,
"TIME": pyarrow_time,
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test__pyarrow_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def module_under_test():

def test_bq_to_arrow_scalars(module_under_test):
assert (
module_under_test.bq_to_arrow_scalars("BIGNUMERIC")
== module_under_test.pyarrow_bignumeric
module_under_test.bq_to_arrow_scalars("BIGNUMERIC")()
== module_under_test.pyarrow_bignumeric()
)
assert (
module_under_test.bq_to_arrow_scalars("JSON")
module_under_test.bq_to_arrow_scalars("JSON")()
== module_under_test.json_arrow_type
)
assert module_under_test.bq_to_arrow_scalars("UNKNOWN_TYPE") is None
Expand Down

0 comments on commit df87a70

Please sign in to comment.