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

convert-examples 6.1/ feature_graph_backed_assets pyproject, @repository -> Definitions #11072

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .repository import feature_graph_backed_assets
from .repository import defs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from dagster import (
AssetSelection,
AssetsDefinition,
Definitions,
GraphOut,
define_asset_job,
graph,
load_assets_from_package_module,
op,
repository,
)


Expand Down Expand Up @@ -55,11 +55,11 @@ def layover_breakdown_2022(us_flights):
airline_job = define_asset_job("airline_job", AssetSelection.keys("passenger_flights").downstream())


@repository
def feature_graph_backed_assets():
return [
load_assets_from_package_module(assets),
define_asset_job("airline_job", AssetSelection.keys("passenger_flights").downstream()),
defs = Definitions(
assets=[
*load_assets_from_package_module(assets),
AssetsDefinition.from_graph(us_assets),
AssetsDefinition.from_graph(layover_breakdown_2022),
]
],
jobs=[define_asset_job("airline_job", AssetSelection.keys("passenger_flights").downstream())],
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from feature_graph_backed_assets import feature_graph_backed_assets
from feature_graph_backed_assets import defs

from dagster._core.test_utils import instance_for_test


def test_feature_graph_backed_assets():
with instance_for_test() as instance:
assert (
feature_graph_backed_assets.get_job("airline_job")
.execute_in_process(instance=instance)
.success
)
assert defs.get_job_def("airline_job").execute_in_process(instance=instance).success
6 changes: 6 additions & 0 deletions examples/feature_graph_backed_assets/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.dagster]
python_package = "feature_graph_backed_assets"
2 changes: 0 additions & 2 deletions examples/feature_graph_backed_assets/workspace.yaml

This file was deleted.