Has anybody encountered this error before? I have ...
# ask-community
s
Has anybody encountered this error before? I have confirmed that my custom schema is not being defined anywhere else? Error in 🧵
image.png
o
Hi @Shane Kalepp! To confirm, the database-based io managers expect to figure out which schema to store a given asset to in one of two ways: • the asset key's prefix (["raw", "line"] gets stored in the "line" table inside the "raw" schema) • the configuration of the IOManager (a schema is explicitly set) in the case that you have an asset key with two parts (as you do), and a schema is explicitly set when configuring the database IOManager (is this the case?), I'd expect to see this error the quick solution would be to either change the asset key to ["SKALEPP", "line"] and remove the IOManager config, or to change the asset key to ["line"]
D 1
It's possible that you're not explicitly setting the "raw" asset prefix, and instead that's being set on something like "load_assets_from_package_module"
s
Hi @owen - Thank you for the response! I was able to get this to work by removing the schema's being hard coded from the
snowflake_io_manager
. My thought is the
key_prefix="raw"
was conflicting with the io manager.
Copy code
resources = {
    "local": {
        "snowflake_io_manager": SnowflakePandasIOManager(
            account=EnvVar("SNOWFLAKE_ACCOUNT"),
            user=EnvVar("SNOWFLAKE_USER"),
            password=EnvVar("SNOWFLAKE_PASSWORD"),
            warehouse=EnvVar("SNOWFLAKE_WAREHOUSE"),
            database="DEV",
            # schema="raw",
        ),
        "dbt": DbtCliClientResource(
            project_dir=DBT_PROJECT_DIR,
            profiles_dir=DBT_PROFILE_DIR,
            target="dev",
        ),
    },
    "staging": {
        "snowflake_io_manager": SnowflakePandasIOManager(
            account=EnvVar("SNOWFLAKE_ACCOUNT"),
            user=EnvVar("SNOWFLAKE_USER"),
            password=EnvVar("SNOWFLAKE_PASSWORD"),
            warehouse=EnvVar("SNOWFLAKE_WAREHOUSE"),
            database="STAGING",
            # schema=EnvVar("SNOWFLAKE_SCHEMA"),
        ),
        "dbt": DbtCliClientResource(
            project_dir=DBT_PROJECT_DIR,
            profiles_dir=DBT_PROFILE_DIR,
            target="staging",
        ),
    },
    "production": {
        "snowflake_io_manager": SnowflakePandasIOManager(
            account=EnvVar("SNOWFLAKE_ACCOUNT"),
            user=EnvVar("SNOWFLAKE_USER"),
            password=EnvVar("SNOWFLAKE_PASSWORD"),
            warehouse=EnvVar("SNOWFLAKE_WAREHOUSE"),
            database=EnvVar("SNOWFLAKE_DATABASE"),
            # schema=EnvVar("SNOWFLAKE_SCHEMA"),
        ),
        "dbt": DbtCliClientResource(
            project_dir=DBT_PROJECT_DIR,
            profiles_dir=DBT_PROFILE_DIR,
            target="prod",
        ),
    },
}