@@ -2456,6 +2456,7 @@ def load_table_from_dataframe(
24562456 project : str = None ,
24572457 job_config : LoadJobConfig = None ,
24582458 parquet_compression : str = "snappy" ,
2459+ parquet_use_compliant_nested_type : bool = True ,
24592460 timeout : float = DEFAULT_TIMEOUT ,
24602461 ) -> job .LoadJob :
24612462 """Upload the contents of a table from a pandas DataFrame.
@@ -2519,18 +2520,34 @@ def load_table_from_dataframe(
25192520 :attr:`~google.cloud.bigquery.job.SourceFormat.PARQUET` are
25202521 supported.
25212522 parquet_compression (Optional[str]):
2522- [Beta] The compression method to use if intermittently
2523- serializing ``dataframe`` to a parquet file.
2524-
2525- The argument is directly passed as the ``compression``
2526- argument to the underlying ``pyarrow.parquet.write_table()``
2527- method (the default value "snappy" gets converted to uppercase).
2528- https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html#pyarrow-parquet-write-table
2529-
2530- If the job config schema is missing, the argument is directly
2531- passed as the ``compression`` argument to the underlying
2532- ``DataFrame.to_parquet()`` method.
2533- https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_parquet.html#pandas.DataFrame.to_parquet
2523+ [Beta] The compression method to use if intermittently
2524+ serializing ``dataframe`` to a parquet file.
2525+
2526+ The argument is directly passed as the ``compression``
2527+ argument to the underlying ``pyarrow.parquet.write_table()``
2528+ method (the default value "snappy" gets converted to uppercase).
2529+ https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html#pyarrow-parquet-write-table
2530+
2531+ If the job config schema is missing, the argument is directly
2532+ passed as the ``compression`` argument to the underlying
2533+ ``DataFrame.to_parquet()`` method.
2534+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_parquet.html#pandas.DataFrame.to_parquet
2535+ parquet_use_compliant_nested_type (bool):
2536+ Whether the ``pyarrow.parquet.write_table`` serializing method should write
2537+ compliant Parquet nested type (lists). Defaults to ``True``.
2538+
2539+ The argument is directly passed as the ``use_compliant_nested_type``
2540+ argument to the underlying ``pyarrow.parquet.write_table()``
2541+ method.
2542+ https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_table.html#pyarrow-parquet-write-table
2543+
2544+ If the job config schema is missing, the argument is directly
2545+ passed as an additonal ``kwarg`` argument to the underlying
2546+ ``DataFrame.to_parquet()`` method.
2547+ https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_parquet.html#pandas.DataFrame.to_parquet
2548+
2549+ This argument is only present to allow for backwards compatibility with
2550+ tables created using an old version of this method.
25342551 timeout (Optional[float]):
25352552 The number of seconds to wait for the underlying HTTP transport
25362553 before using ``retry``.
@@ -2647,9 +2664,15 @@ def load_table_from_dataframe(
26472664 job_config .schema ,
26482665 tmppath ,
26492666 parquet_compression = parquet_compression ,
2667+ parquet_use_compliant_nested_type = parquet_use_compliant_nested_type ,
26502668 )
26512669 else :
2652- dataframe .to_parquet (tmppath , compression = parquet_compression )
2670+ dataframe .to_parquet (
2671+ tmppath ,
2672+ engine = "pyarrow" ,
2673+ compression = parquet_compression ,
2674+ use_compliant_nested_type = parquet_use_compliant_nested_type ,
2675+ )
26532676
26542677 else :
26552678
0 commit comments