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

Added Conditional Formatting Rules logic #1509

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mcorrigan
Copy link

Added some logic for handling the retrieval and removal of conditional formatting rules.

I can't run the tests on my work account, but I believe they are correct. Feel free to do what you will with it.

@alifeee
Copy link
Collaborator

alifeee commented Sep 9, 2024

Hi

I ran your tests locally with (I use PowerShell on Windows), and fixed a couple of errors.

> $env:GS_RECORD_MODE="all"
> $env:GS_CREDS_FILENAME="tests/creds.json"   
> pytest -k "conditional_format" -v -s

Please see the contributing guide for more help on how to run tests

However, the tests still fail.

Please could you explain the motivation for your change? :)

@mcorrigan
Copy link
Author

Hi

I ran your tests locally with (I use PowerShell on Windows), and fixed a couple of errors.

> $env:GS_RECORD_MODE="all"
> $env:GS_CREDS_FILENAME="tests/creds.json"   
> pytest -k "conditional_format" -v -s

Please see the contributing guide for more help on how to run tests

However, the tests still fail.

Please could you explain the motivation for your change? :)

Thanks for catching those, it would definitely be easier if I could run the tests myself but I'm not set up to do that at the moment.

The reason for the changes was just to get and set conditional formats in the Google Sheet via your API instead of directly through the client.

https://developers.google.com/sheets/api/guides/conditional-format

@alifeee
Copy link
Collaborator

alifeee commented Sep 19, 2024

before I continue, have you looked at gspread formatting?

find https://gspread-formatting.readthedocs.io/en/latest/index.html on https://docs.gspread.org/en/latest/community.html

@mcorrigan
Copy link
Author

I had no idea that existed, it looks awesome! Probably would work for what I'm trying to do here. I'll look at trying it out with my code. Thanks!

@mcorrigan
Copy link
Author

Maybe you already can do this, but one thing that would be nice is if there was a simple interface to performing batch operations in gspread like exists in gspread-formatting but with simple function calls like hide_columns() and hide_rows() instead of aggregating request objects.

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

Successfully merging this pull request may close these issues.

2 participants