internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: googleapis/python-bigquery

Issue:
Require packaging>=20.0
#### Environment details

  - OS type and version: CentOS 7
  - Python version: 3.7.4
  - pip version: 21.3.1
  - `google-cloud-bigquery` version: 3.3.5

#### Steps to reproduce

  1. Install packaging==19.2, which is in required "packaging >= 14.3, <22.0.0dev"
  2. Try accessing use_compliant_nested_type property from google.cloud.bigquery._helpers.PyarrowVersions

#### Code example

```
>>> from google.cloud.bigquery._helpers import PyarrowVersions
>>> import packaging.version
>>> v = PyarrowVersions().use_compliant_nested_type
```

#### Stack trace
```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "env/lib/python3.7/site-packages/google/cloud/bigquery/_helpers.py", line 121, in use_compliant_nested_type
    return self.installed_version.major >= 4
AttributeError: 'Version' object has no attribute 'major'
```

This is resolved by setting dependency versions to "packaging >= 20.0, <22.0.0dev"


Discussion:

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -300,6 +300,11 @@ def prerelease_deps(session):
         "--upgrade",
         "pandas",
     )
+    session.install(
+        "--pre",
+        "--upgrade",
+        "git+https://github.com/pypa/packaging.git",
+    )
 
     session.install(
         "--pre",
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@
     # https://github.com/googleapis/google-cloud-python/issues/10566
     "google-cloud-core >= 1.4.1, <3.0.0dev",
     "google-resumable-media >= 0.6.0, < 3.0dev",
-    "packaging >= 14.3, <22.0.0dev",
+    "packaging >= 20.0.0",
     "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",  # For the legacy proto-based types.
     "python-dateutil >= 2.7.2, <3.0dev",
     "requests >= 2.21.0, < 3.0.0dev",


Test patch:
diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt
--- a/testing/constraints-3.7.txt
+++ b/testing/constraints-3.7.txt
@@ -17,6 +17,7 @@ ipython==7.0.1
 opentelemetry-api==1.1.0
 opentelemetry-instrumentation==0.20b0
 opentelemetry-sdk==1.1.0
+packaging==20.0.0
 pandas==1.1.0
 proto-plus==1.22.0
 protobuf==3.19.5
Repository: googleapis/python-bigquery

Issue:
Kokoro failing due to `mypy_samples`
```
nox > mypy --config-file /tmpfs/src/github/python-bigquery/samples/mypy.ini --no-incremental samples/
samples/magics/query_params_scalars.py:26: error: Module has no attribute "get_ipython"
samples/magics/query.py:26: error: Module has no attribute "get_ipython"
samples/magics/conftest.py:21: error: Module "IPython.core.interactiveshell" has no attribute "TerminalInteractiveShell"; maybe "InteractiveShell"?
samples/snippets/jupyter_tutorial_test.py:37: error: Returning Any from function declared to return "TerminalInteractiveShell"
Found 4 errors in 4 files (checked 218 source files)
```

https://source.cloud.google.com/results/invocations/c82d12de-2c5f-4242-9f1f-57db4c7f950d/targets/cloud-devrel%2Fclient-libraries%2Fpython%2Fgoogleapis%2Fpython-bigquery%2Fpresubmit%2Fpresubmit/log


Discussion:

Resolving patch:
diff --git a/google/__init__.py b/google/__init__.py
--- a/google/__init__.py
+++ b/google/__init__.py
@@ -21,4 +21,4 @@
 except ImportError:
     import pkgutil
 
-    __path__ = pkgutil.extend_path(__path__, __name__)
+    __path__ = pkgutil.extend_path(__path__, __name__)  # type: ignore
diff --git a/google/cloud/bigquery/opentelemetry_tracing.py b/google/cloud/bigquery/opentelemetry_tracing.py
--- a/google/cloud/bigquery/opentelemetry_tracing.py
+++ b/google/cloud/bigquery/opentelemetry_tracing.py
@@ -18,9 +18,9 @@
 
 logger = logging.getLogger(__name__)
 try:
-    from opentelemetry import trace
-    from opentelemetry.instrumentation.utils import http_status_to_status_code
-    from opentelemetry.trace.status import Status
+    from opentelemetry import trace  # type: ignore
+    from opentelemetry.instrumentation.utils import http_status_to_status_code  # type: ignore
+    from opentelemetry.trace.status import Status  # type: ignore
 
     HAS_OPENTELEMETRY = True
     _warned_telemetry = True
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -200,12 +200,22 @@ def mypy_samples(session):
     """Run type checks with mypy."""
     session.install("-e", ".[all]")
 
-    session.install("ipython", "pytest")
+    session.install("pytest")
+    for requirements_path in CURRENT_DIRECTORY.glob("samples/*/requirements.txt"):
+        session.install("-r", requirements_path)
     session.install(MYPY_VERSION)
 
     # Just install the dependencies' type info directly, since "mypy --install-types"
     # might require an additional pass.
-    session.install("types-mock", "types-pytz")
+    session.install(
+        "types-mock",
+        "types-pytz",
+        "types-protobuf",
+        "types-python-dateutil",
+        "types-requests",
+        "types-setuptools",
+    )
+
     session.install("typing-extensions")  # for TypedDict in pre-3.8 Python versions
 
     session.run(


Test patch:
Repository: googleapis/python-bigquery

Issue:
Add __str__ method to DatasetReference
Thanks for stopping by to let us know something could be better!

**PLEASE READ**: If you have a support contract with Google, please create an issue in the [support console](https://cloud.google.com/support/) instead of filing on GitHub. This will ensure a timely response.

 **Is your feature request related to a problem? Please describe.**
I can `str(TableReference)` - which is great! I want to also be able to do that with `DatasetReference`. Easy enough fix.
 **Describe the solution you'd like**
A `__str__` method for `DatasetReference`
 **Describe alternatives you've considered**
This would be the most idiomatic implementation, consistent with `DatasetReference`
 **Additional context**
Here's a draft PR: https://github.com/googleapis/python-bigquery/pull/1288



Discussion:

Resolving patch:
diff --git a/google/cloud/bigquery/dataset.py b/google/cloud/bigquery/dataset.py
--- a/google/cloud/bigquery/dataset.py
+++ b/google/cloud/bigquery/dataset.py
@@ -215,6 +215,9 @@ def __ne__(self, other):
     def __hash__(self):
         return hash(self._key())
 
+    def __str__(self):
+        return f"{self.project}.{self._dataset_id}"
+
     def __repr__(self):
         return "DatasetReference{}".format(self._key())
 


Test patch:
diff --git a/tests/unit/test_dataset.py b/tests/unit/test_dataset.py
--- a/tests/unit/test_dataset.py
+++ b/tests/unit/test_dataset.py
@@ -622,6 +622,10 @@ def test___repr__(self):
         expected = "DatasetReference('project1', 'dataset1')"
         self.assertEqual(repr(dataset), expected)
 
+    def test___str__(self):
+        dataset = self._make_one("project1", "dataset1")
+        self.assertEqual(str(dataset), "project1.dataset1")
+
 
 class TestDataset(unittest.TestCase):
     from google.cloud.bigquery.dataset import DatasetReference
Repository: googleapis/python-bigquery

Issue:
"https://www.googleapis.com/auth/bigquery" scope is unecessary
https://github.com/googleapis/python-bigquery/blob/e1aa9218ad22f85c9a6cab8b61d013779376a582/google/cloud/bigquery/client.py#L229

`"https://www.googleapis.com/auth/cloud-platform"` is a superset of `"https://www.googleapis.com/auth/bigquery"`. We should only need 1, and per the rest of cloud we should use `"https://www.googleapis.com/auth/cloud-platform"`

Note: I'm filing this issue due to https://github.com/googleapis/google-auth-library-python/issues/1204. I believe that even after the issue identified there is addressed (default scopes shouldn't cause user/impersonated credentials to downscope), google-auth might be downscoping credentials unnecessarily because it sees the "bigquery" scope and it's not present by default.


Discussion:

Resolving patch:
diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py
--- a/google/cloud/bigquery/client.py
+++ b/google/cloud/bigquery/client.py
@@ -225,10 +225,7 @@ class Client(ClientWithProject):
             to acquire default credentials.
     """
 
-    SCOPE = (  # type: ignore
-        "https://www.googleapis.com/auth/bigquery",
-        "https://www.googleapis.com/auth/cloud-platform",
-    )
+    SCOPE = ("https://www.googleapis.com/auth/cloud-platform",)  # type: ignore
     """The scopes required for authenticating as a BigQuery consumer."""
 
     def __init__(


Test patch:
Repository: googleapis/python-bigquery

Issue:
ipywidgets extra pinned too tightly
https://github.com/googleapis/python-bigquery/blob/v3.4.2/setup.py#L70

I notice we have `"ipywidgets==7.7.1"`. This will likely give folks trouble as ipywidgets is updated. We should try to expand this when we can.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -67,7 +67,7 @@
         pyarrow_dependency,
         "db-dtypes>=0.3.0,<2.0.0dev",
     ],
-    "ipywidgets": ["ipywidgets==7.7.1"],
+    "ipywidgets": ["ipywidgets>=7.7.0,<8.0.1"],
     "geopandas": ["geopandas>=0.9.0, <1.0dev", "Shapely>=1.8.4, <2.0dev"],
     "ipython": ["ipython>=7.0.1,!=8.1.0"],
     "tqdm": ["tqdm >= 4.7.4, <5.0.0dev"],


Test patch:
Repository: googleapis/python-bigquery

Issue:
make `google-cloud-bigquery-storage>=2.6.0` the minimum version
2.6.0 makes `read_session` optional to `rows()` (used in pandas connector).

BLOCKED: wait for a few versions of `google-cloud-bigquery-storage` before bumping the minimum.

(TODO: I still want to figure out how long it takes people to upgrade naturally so that we can set some data-driven policies around deps upgrades)


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -51,7 +51,7 @@
     # Keep the no-op bqstorage extra for backward compatibility.
     # See: https://github.com/googleapis/python-bigquery/issues/757
     "bqstorage": [
-        "google-cloud-bigquery-storage >= 2.0.0, <3.0.0dev",
+        "google-cloud-bigquery-storage >= 2.6.0, <3.0.0dev",
         # Due to an issue in pip's dependency resolver, the `grpc` extra is not
         # installed, even though `google-cloud-bigquery-storage` specifies it
         # as `google-api-core[grpc]`. We thus need to explicitly specify it here.


Test patch:
diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt
--- a/testing/constraints-3.7.txt
+++ b/testing/constraints-3.7.txt
@@ -8,7 +8,7 @@
 db-dtypes==0.3.0
 geopandas==0.9.0
 google-api-core==1.31.5
-google-cloud-bigquery-storage==2.0.0
+google-cloud-bigquery-storage==2.6.0
 google-cloud-core==1.6.0
 google-resumable-media==0.6.0
 grpcio==1.47.0
diff --git a/tests/unit/job/test_query_pandas.py b/tests/unit/job/test_query_pandas.py
--- a/tests/unit/job/test_query_pandas.py
+++ b/tests/unit/job/test_query_pandas.py
@@ -59,12 +59,6 @@
 
 @pytest.fixture
 def table_read_options_kwarg():
-    # Create a BigQuery Storage table read options object with pyarrow compression
-    # enabled if a recent-enough version of google-cloud-bigquery-storage dependency is
-    # installed to support the compression.
-    if not hasattr(bigquery_storage, "ArrowSerializationOptions"):
-        return {}
-
     read_options = bigquery_storage.ReadSession.TableReadOptions(
         arrow_serialization_options=bigquery_storage.ArrowSerializationOptions(
             buffer_compression=bigquery_storage.ArrowSerializationOptions.CompressionCodec.LZ4_FRAME
Repository: googleapis/python-bigquery

Issue:
Missing return types in some methods on cloud.google.com documentation
Note that `schema_from_json` returns a list of SchemaField objects, but there's no indication of that here: https://cloud.google.com/python/docs/reference/bigquery/latest/google.cloud.bigquery.client.Client#google_cloud_bigquery_client_Client_schema_to_json


Discussion:
Just a note with some investigation - it does seem like these are generated from the docstrings via Cloud RAD and I did see a few methods where there was info in the docstring that doesn't seem to have been published to the docs. I'm looking into a republish now

Edit - it was last published April 19, 2023, but I'll still see if I can trigger another. If it doesn't work on the republish, I'll dig deeper to see why certain docstrings don't appear. 

Resolving patch:
diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py
--- a/google/cloud/bigquery/client.py
+++ b/google/cloud/bigquery/client.py
@@ -327,7 +327,8 @@ def get_service_account_email(
                 before using ``retry``.
 
         Returns:
-            str: service account email address
+            str:
+                service account email address
 
         Example:
 
@@ -1932,7 +1933,8 @@ def job_from_resource(
             resource (Dict): one job resource from API response
 
         Returns:
-            The job instance, constructed via the resource.
+            Union[job.CopyJob, job.ExtractJob, job.LoadJob, job.QueryJob, job.UnknownJob]:
+                The job instance, constructed via the resource.
         """
         config = resource.get("configuration", {})
         if "load" in config:
@@ -2064,7 +2066,8 @@ def get_job(
                 before using ``retry``.
 
         Returns:
-            Job instance, based on the resource returned by the API.
+            Union[job.LoadJob, job.CopyJob, job.ExtractJob, job.QueryJob, job.UnknownJob]:
+                Job instance, based on the resource returned by the API.
         """
         extra_params = {"projection": "full"}
 
@@ -3954,12 +3957,13 @@ def _schema_to_json_file_object(self, schema_list, file_obj):
         """
         json.dump(schema_list, file_obj, indent=2, sort_keys=True)
 
-    def schema_from_json(self, file_or_path: "PathType"):
+    def schema_from_json(self, file_or_path: "PathType") -> List[SchemaField]:
         """Takes a file object or file path that contains json that describes
         a table schema.
 
         Returns:
-            List of schema field objects.
+            List[SchemaField]:
+                List of :class:`~google.cloud.bigquery.schema.SchemaField` objects.
         """
         if isinstance(file_or_path, io.IOBase):
             return self._schema_from_json_file_object(file_or_path)


Test patch:
Repository: googleapis/python-bigquery

Issue:
Type annotation incorrect for `job_config` argument(s)
To make mypy happy when I have an optional `job_config`, I'm having to write code like this:

```python
        if job_config is not None:
            query_job = self.bqclient.query(sql, job_config=job_config)
        else:
            query_job = self.bqclient.query(sql)
```

This if/else should be unnecessary, but mypy complains that `job_config` argument to `query` can't be `None`.

The root cause is that the type annotation is only `QueryJobConfig`

https://github.com/googleapis/python-bigquery/blob/130450a3a5d866d2d48ef0c396e9f37d22d0b1d5/google/cloud/bigquery/client.py#L3274

It should be `Optional[QueryJobConfig]`.

This same issue occurs in `copy_table` and `extract_table`.


Discussion:

Resolving patch:
diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py
--- a/google/cloud/bigquery/client.py
+++ b/google/cloud/bigquery/client.py
@@ -3070,7 +3070,7 @@ def copy_table(
         job_id_prefix: Optional[str] = None,
         location: Optional[str] = None,
         project: Optional[str] = None,
-        job_config: CopyJobConfig = None,
+        job_config: Optional[CopyJobConfig] = None,
         retry: retries.Retry = DEFAULT_RETRY,
         timeout: TimeoutType = DEFAULT_TIMEOUT,
     ) -> job.CopyJob:
@@ -3176,7 +3176,7 @@ def extract_table(
         job_id_prefix: Optional[str] = None,
         location: Optional[str] = None,
         project: Optional[str] = None,
-        job_config: ExtractJobConfig = None,
+        job_config: Optional[ExtractJobConfig] = None,
         retry: retries.Retry = DEFAULT_RETRY,
         timeout: TimeoutType = DEFAULT_TIMEOUT,
         source_type: str = "Table",
@@ -3271,7 +3271,7 @@ def extract_table(
     def query(
         self,
         query: str,
-        job_config: QueryJobConfig = None,
+        job_config: Optional[QueryJobConfig] = None,
         job_id: Optional[str] = None,
         job_id_prefix: Optional[str] = None,
         location: Optional[str] = None,


Test patch:
Repository: googleapis/python-bigquery

Issue:
Lint session fails with flake8==6.1.0
`flake8==6.1.0` was released on July 29th. 
https://pypi.org/project/flake8/6.1.0/#history

When running the lint check with `flake8==6.1.0` , the check fails with the following errors:

```
(py38) partheniou@partheniou-vm-3:~/git/python-bigquery$ nox -s lint
nox > Running session lint
nox > Creating virtual environment (virtualenv) using python3.8 in .nox/lint
nox > python -m pip install flake8 black==22.3.0
nox > python -m pip install -e .
nox > flake8 google/cloud/bigquery
google/cloud/bigquery/client.py:256:16: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
google/cloud/bigquery/job/query.py:1345:12: E721 do not compare types, for exact checks use `is` / `is not`, for instance checks use `isinstance()`
nox > Command flake8 google/cloud/bigquery failed with exit code 1
nox > Session lint failed.
```


Discussion:

Resolving patch:
diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py
--- a/google/cloud/bigquery/client.py
+++ b/google/cloud/bigquery/client.py
@@ -1895,7 +1895,7 @@ def _get_query_results(
         extra_params: Dict[str, Any] = {"maxResults": 0}
 
         if timeout is not None:
-            if type(timeout) == object:
+            if not isinstance(timeout, (int, float)):
                 timeout = _MIN_GET_QUERY_RESULTS_TIMEOUT
             else:
                 timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)
@@ -3927,7 +3927,7 @@ def _list_rows_from_query_results(
         }
 
         if timeout is not None:
-            if type(timeout) == object:
+            if not isinstance(timeout, (int, float)):
                 timeout = _MIN_GET_QUERY_RESULTS_TIMEOUT
             else:
                 timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -375,9 +375,7 @@ def lint(session):
     serious code quality issues.
     """
 
-    # Pin flake8 to 6.0.0
-    # See https://github.com/googleapis/python-bigquery/issues/1635
-    session.install("flake8==6.0.0", BLACK_VERSION)
+    session.install("flake8", BLACK_VERSION)
     session.install("-e", ".")
     session.run("flake8", os.path.join("google", "cloud", "bigquery"))
     session.run("flake8", "tests")


Test patch:
Repository: googleapis/python-bigquery

Issue:
Make compiled packages such as "grpc" and "proto-plus" optional extras
I believe proto-plus / protobuf / grpc packages were only needed for `google.cloud.bigquery_v2`. These modules have been deprecated and disconnected from the `google.cloud.bigquery` modules in version 3.x. I believe this means we can move those dependencies to "extras" (a.k.a. optional dependencies) and make our package lighter-weight by default.

Follow-up to https://github.com/googleapis/python-bigquery/pull/1282/files#discussion_r928022130 and https://github.com/googleapis/python-bigquery/pull/1282/files#discussion_r928022317


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -29,20 +29,16 @@
 # 'Development Status :: 5 - Production/Stable'
 release_status = "Development Status :: 5 - Production/Stable"
 dependencies = [
-    "grpcio >= 1.47.0, < 2.0dev",  # https://github.com/googleapis/python-bigquery/issues/1262
-    "grpcio >= 1.49.1, < 2.0dev; python_version>='3.11'",
     # NOTE: Maintainers, please do not require google-api-core>=2.x.x
     # Until this issue is closed
     # https://github.com/googleapis/google-cloud-python/issues/10566
-    "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
-    "proto-plus >= 1.15.0, <2.0.0dev",
+    "google-api-core >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
     # NOTE: Maintainers, please do not require google-cloud-core>=2.x.x
     # Until this issue is closed
     # https://github.com/googleapis/google-cloud-python/issues/10566
     "google-cloud-core >= 1.6.0, <3.0.0dev",
     "google-resumable-media >= 0.6.0, < 3.0dev",
     "packaging >= 20.0.0",
-    "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",  # For the legacy proto-based types.
     "python-dateutil >= 2.7.2, <3.0dev",
     "requests >= 2.21.0, < 3.0.0dev",
 ]
@@ -82,6 +78,10 @@
         "opentelemetry-sdk >= 1.1.0",
         "opentelemetry-instrumentation >= 0.20b0",
     ],
+    "bigquery_v2": [
+        "proto-plus >= 1.15.0, <2.0.0dev",
+        "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",  # For the legacy proto-based types.
+    ],
 }
 
 all_extras = []


Test patch:
diff --git a/tests/unit/test_legacy_types.py b/tests/unit/test_legacy_types.py
--- a/tests/unit/test_legacy_types.py
+++ b/tests/unit/test_legacy_types.py
@@ -13,9 +13,17 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import pytest
+
 import warnings
 
+try:
+    import proto  # type: ignore
+except ImportError:  # pragma: NO COVER
+    proto = None
+
 
+@pytest.mark.skipif(proto is None, reason="proto is not installed")
 def test_importing_legacy_types_emits_warning():
     with warnings.catch_warnings(record=True) as warned:
         from google.cloud.bigquery_v2 import types  # noqa: F401
Repository: googleapis/python-bigquery

Issue:
Prevent Error: Module "google.oauth2" has no attribute "service_account 
A specific version of `types-protobuf==4.24.0.4` causes the following error:

`Module "google.oauth2" has no attribute "service_account"`

Ensures that the problematic version of `types-protobuf` does not get installed and include a note explaining why the limitation is present.




Discussion:

Resolving patch:
diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -219,7 +219,7 @@ def mypy_samples(session):
     session.install(
         "types-mock",
         "types-pytz",
-        "types-protobuf",
+        "types-protobuf!=4.24.0.20240106",  # This version causes an error: 'Module "google.oauth2" has no attribute "service_account"'
         "types-python-dateutil",
         "types-requests",
         "types-setuptools",


Test patch:
Repository: googleapis/python-bigquery

Issue:
The _ARROW_SCALAR_IDS_TO_BQ mapping misses LargeStringArray type
#### Environment details

  - OS type and version: Linux
  - Python version: 3.11.7
  - pip version: 23.3.1
  - `google-cloud-bigquery` version: 3.16.0

#### Steps to reproduce

Call `bqclient.load_table_from_dataframe` with a dataframe containing a string type. Before pandas 2.2.0, the `pyarrow.array` would detect the type as `pyarrow.lib.StringArray`. After switching to pandas `2.2.0`, the `pyarrow.lib.LargeStringArray` would be returned. But it misses the BQ type mapping.


#### Stack trace

<img width="1470" alt="callstack" src="https://github.com/googleapis/python-bigquery/assets/124939984/fe0c326f-8875-41b5-abff-e91dc3e574da">

The left results are in `pandas 2.2.0` and the right result are from `pandas 2.1.3`




Discussion:

Resolving patch:
diff --git a/google/cloud/bigquery/_pyarrow_helpers.py b/google/cloud/bigquery/_pyarrow_helpers.py
--- a/google/cloud/bigquery/_pyarrow_helpers.py
+++ b/google/cloud/bigquery/_pyarrow_helpers.py
@@ -91,6 +91,7 @@ def pyarrow_timestamp():
         pyarrow.date64().id: "DATETIME",  # because millisecond resolution
         pyarrow.binary().id: "BYTES",
         pyarrow.string().id: "STRING",  # also alias for pyarrow.utf8()
+        pyarrow.large_string().id: "STRING",
         # The exact scale and precision don't matter, see below.
         pyarrow.decimal128(38, scale=9).id: "NUMERIC",
     }


Test patch: