Hello everyone, could someone give me a pointer on...
# ask-community
k
Hello everyone, could someone give me a pointer on how Dagster finds the content of a SourceAsset? For example, if I have a pre-computed .csv file I want to make available as a SourceAsset, how do I tell Dagster where that file is located?
🤖 1
dagster bot responded by community 1
v
k
Thanks @Vinnie! This makes sense - is there an example that you know of anywhere? The io managers that I’ve been using for software-defined assets don’t specify a file name or location, since that is determined by the asset, it’s partitions, and DAGSTER_HOME. So I am a little unclear on how to do this for SourceAssets.
v
Warning: I’m just spitballing since I never worked with this, but I’m imagining it would look something like this:
Copy code
class MySourceAssetIOManager(ConfigurableIOManager):
    def load_input(self, context):
        with open("my/asset/path") as f:
            return f.read()

SourceAsset("my_source_asset", io_manager_def=MySourceAssetIOManager)
Basically I assume you’d have to find a way to tell your IO Manager where to find the source asset, this could be done with the asset keys or other information you can find within the `InputContext`(https://github.com/dagster-io/dagster/blob/master/python_modules/dagster/dagster/_core/execution/context/input.py#L39)
k
ok, thanks! I’ll look into it and mess around