Skip to content

Commit

Permalink
ruff and remove kinds
Browse files Browse the repository at this point in the history
  • Loading branch information
PedramNavid committed Aug 23, 2024
1 parent 5380a5d commit dbe4617
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@
def my_asset_modeled_in_yaml(): ...


defs = Definitions(
assets=with_source_code_references([my_asset_modeled_in_yaml])
)
defs = Definitions(assets=with_source_code_references([my_asset_modeled_in_yaml]))
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
from dagster import asset, AssetSpec, MetadataValue
from dagster import AssetSpec, MetadataValue, asset


# You can attach metadata via the `metadata` argument on the `@asset` decorator.
@asset(metadata={
"link_to_docs": MetadataValue.url("https://..."),
"snippet": MetadataValue.md("# Embedded markdown\n...")
})
def my_asset():
...
@asset(
metadata={
"link_to_docs": MetadataValue.url("https://..."),
"snippet": MetadataValue.md("# Embedded markdown\n..."),
}
)
def my_asset(): ...


# You can also use `metadata` with `AssetSpec`
my_external_asset = AssetSpec(
"my_external_asset",
metadata={
"link_to_docs": MetadataValue.url("https://..."),
"snippet": MetadataValue.md("# Embedded markdown\n...")
}
"snippet": MetadataValue.md("# Embedded markdown\n..."),
},
)

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def another_asset(): ...
# only link to github in production. link locally otherwise
if bool(os.getenv("IS_PRODUCTION"))
else assets
)
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from dagster import asset, AssetSpec
from dagster import AssetSpec, asset


# You can attach owners via the `owners` argument on the `@asset` decorator.
@asset(owners=["[email protected]", "team:data-eng"])
def my_asset():
...
def my_asset(): ...


# You can also use `owners` with `AssetSpec`
my_external_asset = AssetSpec(
"my_external_asset",
owners=["[email protected]", "team:roof", "team:corpdev"]
"my_external_asset", owners=["[email protected]", "team:roof", "team:corpdev"]
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from dagster_cloud.metadata.source_code import link_code_references_to_git_if_cloud

from dagster import (
Definitions,
asset,
with_source_code_references,
)
from dagster import Definitions, asset, with_source_code_references


@asset
Expand All @@ -21,4 +17,4 @@ def another_asset(): ...
# This function also supports customizable path mapping, but usually
# the defaults are fine.
)
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def another_asset(): ...
defs = Definitions(
# with_source_code_references() automatically attaches the proper metadata
assets=with_source_code_references([my_asset, another_asset])
)
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from dagster import asset, MetadataValue, MaterializeResult
from dagster import MaterializeResult, MetadataValue, asset


@asset
def my_asset():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ def my_asset():
}
)
}
)
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
from dagster import (
MaterializeResult,
TableColumn,
TableSchema,
asset,
)
from dagster import MaterializeResult, TableColumn, TableSchema, asset


# Definition-time metadata
Expand Down Expand Up @@ -43,7 +38,5 @@ def my_other_asset():
]

return MaterializeResult(
metadata={
"dagster/column_schema": TableSchema(columns=columns)
}
)
metadata={"dagster/column_schema": TableSchema(columns=columns)}
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from dagster import asset, AssetSpec
from dagster import AssetSpec, asset


# You can attach tags via the `tags` argument on the `@asset` decorator.
@asset(tags={"domain": "marketing", "pii": "true"})
def my_asset():
...
def my_asset(): ...


# You can also use `tags` with `AssetSpec`
my_external_asset = AssetSpec(
"my_external_asset",
tags={"domain": "legal", "sensitive": ""}
"my_external_asset", tags={"domain": "legal", "sensitive": ""}
)

0 comments on commit dbe4617

Please sign in to comment.