Hello, I am trying to be get the extra credit here...
# ask-community
c
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?
j
Hey @Chris Nogradi could you share the full
@repository
code? I can try to replicate on my end next week
c
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
j
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?
c
yes repository works fine in dagit. I will try your suggestion about removing the asset rec. - give me a little bit
j
ok no rush - i need to chat with a couple coworkers to better understand the cases when unresolvedrepositorydefinition is created instead of a repositorydefinition
c
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.
j
yeah it might - @ben do you know if the airbyte cacheable assets would make a repository an unresolvedrepository?
b
Yes, I believe if you load any cached assets (e.g. from Airbyte) the @repository decorator returns a
PendingRepositoryDefinition
I believe you can use
repo.compute_repository_definition()
to get the fully fledged
RepositoryDefinition
j
ok ty! then @Chris Nogradi the airbyte assets are likely what’s causing the problem. if you run the
compute_repository_definition
function in your notebook and then use
load_asset_value
i believe it should work
c
Perfect! This work great! Thanks @jamie and @ben
👌 1