Seems to be a code analysis issue from PyCharms side so no need to fix this if everything works fine when ran. If this really bothers you, you could maybe disable it in pycharm: Preferences -> Editor -> Inspections