gspread-formatting icon indicating copy to clipboard operation
gspread-formatting copied to clipboard

Unresolved reference "textFormat"

Open gusleig opened this issue 3 years ago • 1 comments

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 avatar Sep 30 '22 16:09 gusleig

@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))

robin900 avatar Sep 30 '22 18:09 robin900