Skip to content

Commit

Permalink
docstring for AssetsDefinition.get_asset_spec (#23561)
Browse files Browse the repository at this point in the history
## Summary & Motivation

## How I Tested These Changes
  • Loading branch information
sryza authored Aug 9, 2024
1 parent 49b8467 commit 319959f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions python_modules/dagster/dagster/_core/definitions/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,18 @@ def _output_to_source_asset(self, output_name: str) -> SourceAsset:

@public
def get_asset_spec(self, key: Optional[AssetKey] = None) -> AssetSpec:
"""Returns a representation of this asset as an :py:class:`AssetSpec`.
If this is a multi-asset, the "key" argument allows selecting which asset to return the
spec for.
Args:
key (Optional[AssetKey]): If this is a multi-asset, select which asset to return its
AssetSpec. If not a multi-asset, this can be left as None.
Returns:
AssetSpec
"""
return self._specs_by_key[key or self.key]

def get_io_manager_key_for_asset_key(self, key: AssetKey) -> str:
Expand Down

0 comments on commit 319959f

Please sign in to comment.