Skip to content

Commit 3a57815

Browse files
committed
fix: test_dataframe_to_arrow_with_unknown_type testcase
1 parent 8eb8e47 commit 3a57815

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

google/cloud/bigquery/_pandas_helpers.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,13 @@ def _check_nullability(arrow_fields, dataframe):
307307
if dataframe.index.name:
308308
dataframe[dataframe.index.name] = dataframe.index
309309
for arrow_field in arrow_fields:
310-
col_name = arrow_field.name
311-
if (
312-
not arrow_field.nullable
313-
and dataframe[arrow_field.name].isnull().values.any()
314-
):
315-
raise ValueError(f"required field {col_name} can not be nulls")
310+
if arrow_field:
311+
col_name = arrow_field.name
312+
if (
313+
not arrow_field.nullable
314+
and dataframe[arrow_field.name].isnull().values.any()
315+
):
316+
raise ValueError(f"required field {col_name} can not be nulls")
316317

317318

318319
def get_column_or_index(dataframe, name):

0 commit comments

Comments
 (0)