Repository: googlemaps/google-maps-services-python

Issue:
Add the ability to filter place reviews by newest.
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/). This will ensure a timely response. 

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform [support resources page](https://developers.google.com/maps/support/). 

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform [issue trackers](https://developers.google.com/maps/support/#issue_tracker).

Check for answers on StackOverflow with the [google-maps](http://stackoverflow.com/questions/tagged/google-maps) tag.

---

 **Is your feature request related to a problem? Please describe.**
I would like to be able to filter place reviews by newest, rather than just the default.

 **Describe the solution you'd like**
I would like to be able to pass a simple parameter to filter for the newest reviews for a place.

 **Describe alternatives you've considered**
There is no alternative, other than using the default filter.

 **Additional context**
Add any other context or screenshots about the feature request here.


Discussion:
jloffredo2: CLA has been signed
nnolan: Please let me know if anything else is required for this PR. Would love to see this feature implemented as soon as possible.

Patch:
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 0000000..c83d6c3
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,63 @@
+# Copyright 2023 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# A workflow that pushes artifacts to Sonatype
+name: Publish
+
+on:
+  push:
+    tags:
+      - '*'
+  repository_dispatch:
+    types: [docs]
+
+jobs:
+  docs:
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v3
+
+    - name: Setup Python
+      uses: "actions/setup-python@v3"
+      with:
+        python-version: "3.9"
+
+    - name: Install dependencies
+      run: ./.github/scripts/install.sh
+
+    - name: Generate docs
+      run: python3 -m nox --session docs
+
+    - name: Update gh-pages branch with docs
+      run: |
+        echo "Creating tar for generated docs"
+        cd ./docs/_build/html && tar cvf ~/docs.tar .
+
+        echo "Unpacking tar into gh-pages branch"
+        git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
+        cd $GITHUB_WORKSPACE && git checkout gh-pages && tar xvf ~/docs.tar
+
+    - name: PR Changes
+      uses: peter-evans/create-pull-request@v4
+      with:
+        token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
+        commit-message: 'docs: Update docs'
+        committer: googlemaps-bot <googlemaps-bot@google.com>
+        author: googlemaps-bot <googlemaps-bot@google.com>
+        title: 'docs: Update docs'
+        body: |
+            Updated GitHub pages with latest from `python3 -m nox --session docs`.
+        branch: googlemaps-bot/update_gh_pages
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ce78e64..a0a28dc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -23,11 +23,11 @@ jobs:
       PYTHONDONTWRITEBYTECODE: 1
     steps:
     - name: Setup Python
-      uses: "actions/setup-python@v1"
+      uses: "actions/setup-python@v3"
       with:
         python-version: "3.9"
     - name: Checkout
-      uses: actions/checkout@v2
+      uses: actions/checkout@v3
       with:
         token: ${{ secrets.SYNCED_GITHUB_TOKEN_REPO }}
     - name: Install dependencies
@@ -37,8 +37,9 @@ jobs:
     - name: Cleanup old dist
       run: rm -rf googlemaps-* dist/
     - name: Semantic Release
-      uses: cycjimmy/semantic-release-action@v2
+      uses: cycjimmy/semantic-release-action@v3
       with:
+        semantic_version: 19
         extra_plugins: |
           "@semantic-release/commit-analyzer"
           "@semantic-release/release-notes-generator"
diff --git a/googlemaps/__init__.py b/googlemaps/__init__.py
index f25d935..be61bb0 100644
--- a/googlemaps/__init__.py
+++ b/googlemaps/__init__.py
@@ -15,7 +15,7 @@
 # the License.
 #
 
-__version__ = "4.7.3"
+__version__ = "4.8.0"
 
 from googlemaps.client import Client
 from googlemaps import exceptions
diff --git a/googlemaps/places.py b/googlemaps/places.py
index 91c14df..35b818f 100644
--- a/googlemaps/places.py
+++ b/googlemaps/places.py
@@ -80,7 +80,7 @@ PLACES_DETAIL_FIELDS_BASIC = {"address_component",
 
 PLACES_DETAIL_FIELDS_CONTACT = {"formatted_phone_number", "international_phone_number", "opening_hours", "website"}
 
-PLACES_DETAIL_FIELDS_ATMOSPHERE = {"price_level", "rating", "review", "user_ratings_total"}
+PLACES_DETAIL_FIELDS_ATMOSPHERE = {"editorial_summary","price_level", "rating", "review", "user_ratings_total"}
 
 PLACES_DETAIL_FIELDS = (
     PLACES_DETAIL_FIELDS_BASIC
@@ -396,7 +396,14 @@ def _places(
     return client._request(url, params)
 
 
-def place(client, place_id, session_token=None, fields=None, language=None):
+def place(
+    client,
+    place_id,
+    session_token=None,
+    fields=None,
+    language=None,
+    reviews_sort="most_relevant"
+):
     """
     Comprehensive details for an individual place.
 
@@ -416,6 +423,10 @@ def place(client, place_id, session_token=None, fields=None, language=None):
     :param language: The language in which to return results.
     :type language: string
 
+    :param reviews_sort: The sorting method to use when returning reviews.
+                         Can be set to most_relevant (default) or newest.
+    :type reviews_sort: string
+
     :rtype: result dict with the following keys:
         result: dict containing place details
         html_attributions: set of attributions which must be displayed
@@ -444,6 +455,8 @@ def place(client, place_id, session_token=None, fields=None, language=None):
         params["language"] = language
     if session_token:
         params["sessiontoken"] = session_token
+    if reviews_sort:
+        params["reviews_sort"] = reviews_sort
 
     return client._request("/maps/api/place/details/json", params)
 
@@ -657,4 +670,3 @@ def _autocomplete(
 
     url = "/maps/api/place/%sautocomplete/json" % url_part
     return client._request(url, params).get("predictions", [])
-    
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 239eceb..3958aed 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,7 @@ with open("CHANGELOG.md") as f:
 
 setup(
     name="googlemaps",
-    version="4.7.3",
+    version="4.8.0",
     description="Python client library for Google Maps Platform",
     long_description=readme + changelog,
     long_description_content_type="text/markdown",


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 286ff75..570a087 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,4 +1,4 @@
-# Copyright 2020 Google LLC
+# Copyright 2023 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -51,4 +51,6 @@ jobs:
     needs: [matrix]
     runs-on: ubuntu-latest
     steps:
-    - run: echo "Test matrix finished"
+    - run: |
+        echo "Test matrix finished";
+        exit 0;
diff --git a/tests/test_places.py b/tests/test_places.py
index 5078177..dd29935 100644
--- a/tests/test_places.py
+++ b/tests/test_places.py
@@ -36,6 +36,7 @@ class PlacesTest(TestCase):
         self.type = "liquor_store"
         self.language = "en-AU"
         self.region = "AU"
+        self.reviews_sort="newest"
         self.radius = 100
 
     @responses.activate
@@ -165,11 +166,12 @@ class PlacesTest(TestCase):
             "ChIJN1t_tDeuEmsRUsoyG83frY4",
             fields=["business_status", "geometry/location", "place_id"],
             language=self.language,
+            reviews_sort=self.reviews_sort,
         )
 
         self.assertEqual(1, len(responses.calls))
         self.assertURLEqual(
-            "%s?language=en-AU&placeid=ChIJN1t_tDeuEmsRUsoyG83frY4"
+            "%s?reviews_sort=newest&language=en-AU&placeid=ChIJN1t_tDeuEmsRUsoyG83frY4"
             "&key=%s&fields=business_status,geometry/location,place_id"
             % (url, self.key),
             responses.calls[0].request.url,