burnash / gspread

Google Sheets Python API
https://docs.gspread.org
MIT License
7.12k stars 948 forks source link

get_notes from a range #1482

Closed twosheds closed 1 month ago

twosheds commented 5 months ago

I think get_notes would be more useful if if could be applied to a range in addition to a worksheet.

muddi900 commented 5 months ago

Would this be a good addition:

-    def get_notes(self, default_empty_value: Optional[str] = "") -> List[List[str]]:
+    def get_notes(
+        self, default_empty_value: Optional[str] = "", range: Optional[str] = None
+    ) -> List[List[str]]:

# ...

         params: ParamsType = {"fields": "sheets.data.rowData.values.note"}
+        if range is not None:
+            params["ranges"] = absolute_range_name(self.title, range)
         res = self.client.spreadsheets_get(self.spreadsheet_id, params)
muddi900 commented 4 months ago

@lavigne958 I have added tested the code and it works as expected.

Should I open a pull request?

alifeee commented 4 months ago

I have added tested the code and it works as expected.

Should I open a pull request?

hi hi @muddi900! thanks for the enthusiasm :)

we'd love to have a PR! it would be great if you created a unit test to test the new functionality, as we try to create for all changes.

if you need some help with the testing framework beyond the contributing guide, let us know and we will be happy to help :)

twosheds commented 1 month ago

Alexandre,

Has this been implemented in 6.1.3 ? I was under the impression that it wouldn't be implemented until 6.2.0.

Regards

John Cook

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Alexandre Lavigne @.> Sent: Monday, October 7, 2024 8:37:14 PM To: burnash/gspread @.> Cc: twosheds @.>; Author @.> Subject: Re: [burnash/gspread] get_notes from a range (Issue #1482)

Closed #1482https://github.com/burnash/gspread/issues/1482 as completed via #1487https://github.com/burnash/gspread/pull/1487.

— Reply to this email directly, view it on GitHubhttps://github.com/burnash/gspread/issues/1482#event-14545888776, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAEXU4EROJYQN7SN7ZV3DJ3Z2LPGVAVCNFSM6AAAAABJJBCODKVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGU2DKOBYHA3TONQ. You are receiving this because you authored the thread.Message ID: @.***>

alifeee commented 1 month ago

it is not in 6.1.3. it will be added in 6.2.0