Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

@activate_pipeline("lol") KeyError 'backend' #9

Closed
renja-g opened this issue Sep 30, 2023 · 2 comments
Closed

@activate_pipeline("lol") KeyError 'backend' #9

renja-g opened this issue Sep 30, 2023 · 2 comments

Comments

@renja-g
Copy link

renja-g commented Sep 30, 2023

Sorry for creating an issue for this, but I don't know where I would otherwise get help from.
I am wondering what this error means:

Exception has occurred: KeyError
'backend'
  File "C:\Users\XXX\Realm-Wrap\backend\utils\pyotconf.py", line 18, in <module>
    @activate_pipeline("lol")
     ^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'backend'

I get this error when loading the pyotconf.py
I copied the pyotconf.py mostly from the docs and just made some minor changes, so I don't know what the problem is, since the error is not that much of a help.

from pyot.conf.model import activate_model, ModelConf
from pyot.conf.pipeline import activate_pipeline, PipelineConf
from dotenv import load_dotenv
import os

# Load env variables
load_dotenv(os.path.join(os.path.dirname(__file__), "..", ".env"))


@activate_model("lol")
class LolModel(ModelConf):
    default_platform = "euw1"
    default_region = "europe"
    default_version = "latest"
    default_locale = "en_us"


@activate_pipeline("lol")
class LolPipeline(PipelineConf):
    name = "lol_main"
    default = True
    stores = [
        {
            "BACKEND": "pyot.stores.riotapi.RiotAPI",
            "API_KEY": os.getenv("RIOT_API_KEY"),
            "RATE_LIMITER": {
                "BACKEND": "pyot.limiters.redis.RedisLimiter",
                "HOST": "redis",
                "PORT": 6379,
                "DB": 0,
                "LIMITING_SHARE": 0.9,
            }
        }
    ]
@iann838
Copy link
Owner

iann838 commented Sep 30, 2023

"backend" not "BACKEND", same goes for the rest of the items in stores, please revise the documentation at https://pyot.iann838.com/cores/configuration. Pyot has remained unchanged for two years already, the uppercase keys were only used in ancient versions of this project.

@iann838 iann838 closed this as completed Sep 30, 2023
@renja-g
Copy link
Author

renja-g commented Sep 30, 2023

ahh, I looked at a repo of yours, that's why I thought I could write it uppercase, but yea, it is a bit older, thanks for your help.

And while I'm here, I also wanted to say that I really like how Pyot is build!
Thanks!

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

No branches or pull requests

2 participants