# Path: pandas_gbq/exceptions.py
# class GenericGBQException(ValueError):
# class AccessDenied(ValueError):
# class ConversionError(GenericGBQException):
# class InvalidPrivateKeyFormat(ValueError):
# class PerformanceWarning(RuntimeWarning):
# 
# Path: pandas_gbq/features.py
# FEATURES = Features()
# 
# Path: pandas_gbq/load.py
# def encode_chunk(dataframe):
# def split_dataframe(dataframe, chunksize=None):
# def cast_dataframe_for_parquet(
#     dataframe: pandas.DataFrame, schema: Optional[Dict[str, Any]],
# ) -> pandas.DataFrame:
# def load_parquet(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
# def load_csv(
#     dataframe: pandas.DataFrame,
#     chunksize: Optional[int],
#     bq_schema: Optional[List[bigquery.SchemaField]],
#     load_chunk: Callable,
# ):
# def load_csv_from_dataframe(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     chunksize: Optional[int],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
#     def load_chunk(chunk, job_config):
# def load_csv_from_file(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     chunksize: Optional[int],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
#     def load_chunk(chunk, job_config):
# def load_chunks(
#     client,
#     dataframe,
#     destination_table_ref,
#     chunksize=None,
#     schema=None,
#     location=None,
#     api_method="load_parquet",
#     billing_project: Optional[str] = None,
# ):


import datetime
import decimal
import textwrap
import db_dtypes
import numpy
import pandas
import pandas.testing
import pytest
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import pyarrow
from io import StringIO
from unittest import mock
from pandas_gbq import exceptions
from pandas_gbq.features import FEATURES
from pandas_gbq import load
    assert sent_schema[0].field_type == "INTEGER"
    assert sent_schema[1].name == "bool_col"
    assert sent_schema[1].field_type == "BOOLEAN"
    assert sent_schema[2].name == "float_col"
    assert sent_schema[2].field_type == "FLOAT"
    assert sent_schema[3].name == "string_col"
    assert sent_schema[3].field_type == "STRING"
    # TODO: Disambiguate TIMESTAMP from DATETIME based on if column is
    # localized or at least use field type from table metadata. See:
    # https://github.com/googleapis/python-bigquery-pandas/issues/450
    assert sent_schema[4].name == "datetime_col"
    assert sent_schema[4].field_type == "TIMESTAMP"
    assert sent_schema[5].name == "timestamp_col"
    assert sent_schema[5].field_type == "TIMESTAMP"


@pytest.mark.parametrize(
    ["bigquery_has_from_dataframe_with_csv", "api_method"],
    [(True, "load_parquet"), (True, "load_csv"), (False, "load_csv")],
)
def test_load_chunks_omits_policy_tags(
    monkeypatch, mock_bigquery_client, bigquery_has_from_dataframe_with_csv, api_method
):
    """Ensure that policyTags are omitted.

    We don't want to change the policyTags via a load job, as this can cause
    403 error. See: https://github.com/googleapis/python-bigquery/pull/557
    """

    monkeypatch.setattr(

# Path: pandas_gbq/exceptions.py
# class GenericGBQException(ValueError):
# class AccessDenied(ValueError):
# class ConversionError(GenericGBQException):
# class InvalidPrivateKeyFormat(ValueError):
# class PerformanceWarning(RuntimeWarning):
# 
# Path: pandas_gbq/features.py
# FEATURES = Features()
# 
# Path: pandas_gbq/load.py
# def encode_chunk(dataframe):
# def split_dataframe(dataframe, chunksize=None):
# def cast_dataframe_for_parquet(
#     dataframe: pandas.DataFrame, schema: Optional[Dict[str, Any]],
# ) -> pandas.DataFrame:
# def load_parquet(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
# def load_csv(
#     dataframe: pandas.DataFrame,
#     chunksize: Optional[int],
#     bq_schema: Optional[List[bigquery.SchemaField]],
#     load_chunk: Callable,
# ):
# def load_csv_from_dataframe(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     chunksize: Optional[int],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
#     def load_chunk(chunk, job_config):
# def load_csv_from_file(
#     client: bigquery.Client,
#     dataframe: pandas.DataFrame,
#     destination_table_ref: bigquery.TableReference,
#     location: Optional[str],
#     chunksize: Optional[int],
#     schema: Optional[Dict[str, Any]],
#     billing_project: Optional[str] = None,
# ):
#     def load_chunk(chunk, job_config):
# def load_chunks(
#     client,
#     dataframe,
#     destination_table_ref,
#     chunksize=None,
#     schema=None,
#     location=None,
#     api_method="load_parquet",
#     billing_project: Optional[str] = None,
# ):


# Path: tests/unit/test_load.py
import datetime
import decimal
import textwrap
import db_dtypes
import numpy
import pandas
import pandas.testing
import pytest
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import google.cloud.bigquery
    import pyarrow
from io import StringIO
from unittest import mock
from pandas_gbq import exceptions
from pandas_gbq.features import FEATURES
from pandas_gbq import load

    assert sent_schema[0].field_type == "INTEGER"
    assert sent_schema[1].name == "bool_col"
    assert sent_schema[1].field_type == "BOOLEAN"
    assert sent_schema[2].name == "float_col"
    assert sent_schema[2].field_type == "FLOAT"
    assert sent_schema[3].name == "string_col"
    assert sent_schema[3].field_type == "STRING"
    # TODO: Disambiguate TIMESTAMP from DATETIME based on if column is
    # localized or at least use field type from table metadata. See:
    # https://github.com/googleapis/python-bigquery-pandas/issues/450
    assert sent_schema[4].name == "datetime_col"
    assert sent_schema[4].field_type == "TIMESTAMP"
    assert sent_schema[5].name == "timestamp_col"
    assert sent_schema[5].field_type == "TIMESTAMP"


@pytest.mark.parametrize(
    ["bigquery_has_from_dataframe_with_csv", "api_method"],
    [(True, "load_parquet"), (True, "load_csv"), (False, "load_csv")],
)
def test_load_chunks_omits_policy_tags(
    monkeypatch, mock_bigquery_client, bigquery_has_from_dataframe_with_csv, api_method
):
    """Ensure that policyTags are omitted.

    We don't want to change the policyTags via a load job, as this can cause
    403 error. See: https://github.com/googleapis/python-bigquery/pull/557
    """

    monkeypatch.setattr(

        type(FEATURES),