Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear_note(cell) Clear a note given specify numeric boundaries does not appear to do anything. #1103

Closed
ugik opened this issue Aug 24, 2022 · 3 comments · Fixed by #1106
Closed
Assignees
Labels
Milestone

Comments

@ugik
Copy link

ugik commented Aug 24, 2022

When I use clear_note(first_row (int) ,first_col (int) ,last_row (int) ,last_col (int) ) nothing happens but clear_note(cellName (str) ) successfully clears the note in that cell, eg. 'A3' for that sheet.

To Reproduce

  • insert a note in cell A5
  • sheet.clear_note(1,1,10,10)
  • note is still there
  • sheet.clear_note('A5')
  • note is gone

Expected behavior
Would expect clear_note(1,1,10,10) to clear notes within the specified range of cells

Code example*
see above under 'reproduce'

Screenshots
If applicable, add screenshots to help explain your problem.

Environment info:

  • Operating System: Linux Mint 'uma' 20.2
  • Python version 3.8.10
  • gspread version 5.4.0
@lavigne958
Copy link
Collaborator

Hi @ugik thank you for reporting this issue.

I confirm the issue.

I noticed the following points:

  • the clear note does not work when you provide a numeric boundaries that are around the note
  • the clear note works fine if the top left coordinates of you numeric boundaries are where the note is located.

I will remove the the option to set numeric boundaries I think, it does make sense here because a cell is not attached to a range but to a cell.
I can only do so on the next major release (6.0.0)

In the mean time I will add some warnings when using it with numeric boundaries that it only clear the note on the top left corner coordinates and is now deprecated and will be removed soon.

That as much as I can do for now.

@lavigne958 lavigne958 self-assigned this Sep 3, 2022
@lavigne958 lavigne958 added the Bug label Sep 3, 2022
@lavigne958 lavigne958 added this to the 5.6.0 milestone Sep 3, 2022
@lavigne958
Copy link
Collaborator

for removal see #1105

@lavigne958
Copy link
Collaborator

Actually I found the real issue, when updating the note to an empty values, we only extract the upper left corner coordinate, then sends that to the API.

By changing that to the a full range, and sending the full range to the API it clears the note as long as the note is within the range.

I will update that part of the code, and we can keep the numeric boundaries 🙂

lavigne958 added a commit that referenced this issue Sep 3, 2022
when using numeric boundaries, extract the full given range
and not just the top left corner.
This allows a user to set/update/clear a complete range.

closes #1103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants