Hello, I am trying to be get the extra credit here...
# ask-community
Hello, I am trying to be get the extra credit here: https://docs.dagster.io/integrations/dagstermill/using-notebooks-with-dagster#extra-credit-fetch-a-dagster-asset-in-a-jupyter-notebook by doing this: from orch.repository import orch output = orch.load_asset_value(asset_key) where orch is: @repository def orch(): But I get this error in the notebook: AttributeError: 'PendingRepositoryDefinition' object has no attribute 'load_asset_value' Thoughts?
Hey @Chris Nogradi could you share the full
code? I can try to replicate on my end next week
Let me get it for you. Also, I am invoking this code in the notebook without running the notebook inside of dagster. Could that be the issue?
@repository def orch(): jobs = [process_sensor] schedules = [process_sensor_schedule] resource_defs=get_resources() loaded_assets = load_assets_from_package_module(assets_) assets = [with_resources( loaded_assets, resource_defs= resource_defs, resource_config_by_key=get_ resource_config_by_key(resource_defs.keys()) )] sensors = [build_asset_reconciliation_sensor( asset_selection=AssetSelection.all(), name="asset_reconciliation_sensor" )] return jobs + schedules + sensors + assets
@jamie thanks for looking at this
hey! yeah replicating this is on my list for this week (hopefully tomorrow)
hey just wanted to check in and say that i’m having trouble replicating this on my end, so i need to do some deeper investigation. however, i just want to confirm: are you able to load the repository in dagit?
this is kinda random too, but could you try removing the asset reconciliation sensor from the repository and try again?
yes repository works fine in dagit. I will try your suggestion about removing the asset rec. - give me a little bit
ok no rush - i need to chat with a couple coworkers to better understand the cases when unresolvedrepositorydefinition is created instead of a repositorydefinition
Also, FYI I am using 1.1.14 and 0.17.14
Also, just a wild guess: I am using Airbyte cacheable assets in repo and I wonder if that changes the way the repo is constructed.
yeah it might - @ben do you know if the airbyte cacheable assets would make a repository an unresolvedrepository?
Yes, I believe if you load any cached assets (e.g. from Airbyte) the @repository decorator returns a
I believe you can use
to get the fully fledged
ok ty! then @Chris Nogradi the airbyte assets are likely what’s causing the problem. if you run the
function in your notebook and then use
i believe it should work
Perfect! This work great! Thanks @jamie and @ben
👌 1