Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from using the deprecated SourceAsset to AssetSpec #3977

Open
2 tasks
Tracked by #3956
bendnorman opened this issue Nov 26, 2024 · 3 comments · May be fixed by #3983
Open
2 tasks
Tracked by #3956

Switch from using the deprecated SourceAsset to AssetSpec #3977

bendnorman opened this issue Nov 26, 2024 · 3 comments · May be fixed by #3983
Labels
community dagster Issues related to our use of the Dagster orchestrator

Comments

@bendnorman
Copy link
Member

bendnorman commented Nov 26, 2024

Switch from using the deprecated SourceAsset to AssetSpec.

The FERC Form 1 and Form 714 raw data are extracted into SQLite files before the main ETL begins. To bring the raw SQLite tables into dagster, we create SourceAssets for all the tables. To create a SourceAsset you just need to initialize it with a table name and an io manager key.

Dagster is removing SourceAssets in 2.0.0 so we need to start using AssetSpecs! This is what the SourceAsset docs say:

Use AssetSpec instead. If using the SourceAsset io_manager_key property, use AssetSpec(...).with_io_manager_key(...)..

Here is an example of how to make this change:

raw_ferc1_dbf_assets = [
SourceAsset(
key=AssetKey(f"raw_ferc1_dbf__{table_name}"),
io_manager_key="ferc1_dbf_sqlite_io_manager",
)
for table_name in dbf_table_names
]

to

raw_ferc1_dbf_assets = [
    AssetSpec(
        key=AssetKey(f"raw_ferc1_dbf__{table_name}"),
    ).with_io_manager_key(""ferc1_dbf_sqlite_io_manager")
    for table_name in dbf_table_names
]

Tasks

Preview Give feedback
@bendnorman bendnorman changed the title Switch from using the deprecated [SourceAsset](https://docs.dagster.io/_apidocs/assets#dagster.SourceAsset) to [AssetSpec](https://docs.dagster.io/concepts/assets/external-assets) Switch from using the deprecated SourceAsset to AssetSpec Nov 26, 2024
@bendnorman bendnorman moved this from New to Backlog in Catalyst Megaproject Nov 26, 2024
@bendnorman bendnorman added the dagster Issues related to our use of the Dagster orchestrator label Nov 26, 2024
@zaneselvans
Copy link
Member

I made a brief attempt at this a couple of weeks ago and ran into some issues. It didn't seem quite as straightforward as they made it sound. See the deprecate-source-assets branch for where I left it.

@bendnorman
Copy link
Member Author

bendnorman commented Dec 2, 2024

Hey @ggurjar333! Are you still interested in taking this on?

@ggurjar333
Copy link

ggurjar333 commented Dec 3, 2024

Yes I have created a branch on this I'll push it today. But I'm still facing some issues on AssetSpec configuration

#3983

@jdangerx jdangerx linked a pull request Dec 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community dagster Issues related to our use of the Dagster orchestrator
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

4 participants