what is wrong with this code? i keep getting error...
# ask-community
what is wrong with this code? i keep getting error and cant figure out why:
Copy code
dagster/_core/workspace/context.py:610: UserWarning: Error loading repository location api.py:dagster._core.errors.DagsterInvalidDefinitionError: resource with key 'feather' required by op 'api_get_list' was not provided. Please provide a <class 'dagster._core.definitions.resource_definition.ResourceDefinition'> to key 'feather', or change the required key to one of the following keys which points to an <class 'dagster._core.definitions.resource_definition.ResourceDefinition'>: ['io_manager']
Copy code
class FeatherManager:
    def __init__(self, directory):
        self.directory = directory
    def get(self, api, assetname):
        filepath = f"{self.directory}/{api}/{assetname}.feather"
        return pd.read_feather(filepath)
    def set(self, api, assetname, df: DataFrame):
        filepath = f"{self.directory}/{api}/{assetname}.feather"
def feather_resource(_):
    directory = os.getenv("DATA_FEATHER_ROOT")
    return FeatherManager(directory)

defs = Definitions(
        "mongo": mongo_resource,
        "redis": redis_resource,
        "feather": feather_resource,
        "parquet": parquet_resource,
Copy code
# other imports ...
from resources import feather_resource
from resources import mongo_resource

def api_get_list(context) -> Output[None]:
    feather = context.resources.feather
    # code to make api call and convert to dataframe ...
    # write df to feather file
    feather.set("api", "api_get_list", df)
    # set metadata on asset
    return Output(
            "computed_at": datetime.now().isoformat(),
            "count": len(df),
            "tickers_first5": df.head(5).to_json(orient="records")

def wbrepo():
    return [
🤖 1
looks like you're double dipping with code locations and repositories. Repositories are deprecated in favor of code locations/definitions. You can fix this by removing the repository you make, and loading thwat asset into the
. You might benefit from looking at our recommended project structure or an example project
i am so lost trying to go through the fully featured project. why dont you guys put comments in the python code explaining each line? its a tutorial not a higly optimized production environment. i have no clue what 50% of these lines are doing as a beginner. especially these init files. its doing so many things that interact with each other and im just trying to understand one thing at a time. i did have a few things working (resources of redis, mongo, parquet, feather and some api calls to feather files) but i will try to move my code into this example structure to see if i can get the defs correctly. i’ll hack some more. thanks.
Hey Kyle, putting more comments into the example code is a good suggestion, we’ll take that into account as we develop our examples. In the meantime if you’re feeling overwhelmed by looking at full-featured examples I strongly recommend going step by step through the tutorial: https://docs.dagster.io/tutorial
❤️ 1
^ i think also putting a link to the docs above sections like this is useful. i just been doing this myself in my own examples to reference when i find them.
Copy code
# DOCS: <https://docs.dagster.io/concepts/code-locations#defining-code-locations>
defs = Definitions(
thank you box 1