gspread-formatting
gspread-formatting copied to clipboard
Unresolved reference "textFormat"
Hi, I'm trying to run this simple formatting but pycharm is unable to find textFormat reference, I've already removed my virtualenv and reinstalled again but I get the same problem. Any ideas? thanks!
(venv) PS C:\Users\Gustavo\PycharmProjects\sgpc-book> python -V Python 3.7.4 (venv) PS C:\Users\Gustavo\PycharmProjects\sgpc-book> pip3 -V pip 22.2.2 from C:\Users\Gustavo\PycharmProjects\sgpc-book\venv\lib\site-packages\pip (python 3.7)
import gspread
from gspread import utils
from gspread_formatting import *
from gspread_formatting.dataframe import *
from gspread_formatting.util import _range_to_gridrange_object, _range_to_dimensionrange_object
rule = ConditionalFormatRule(
ranges=[GridRange.from_a1_range('A1:A2000', worksheet)],
booleanRule=BooleanRule(
condition=BooleanCondition('NUMBER_GREATER', ['100']),
format=CellFormat(textFormat=textFormat(bold=True), backgroundColor=Color(1, 0, 0))
)
)
@gusleig The lowercase versions are probably not visible to PyCharm's code analysis. To avoid the PyCharm warning, use the fully capitalized version:
CellFormat(textFormat=TextFormat(bold=True), backgroundColor=Color(1, 0, 0))