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

[2/n][dagster-sling] Move logic to default fns in DagsterSlingTranslator #27140

Open
wants to merge 4 commits into
base: maxime/sling-asset-spec-1
Choose a base branch
from

Conversation

maximearmstrong
Copy link
Contributor

@maximearmstrong maximearmstrong commented Jan 16, 2025

Summary & Motivation

Move the logic in DagsterSlingTranslator.get_* methods to DagsterSlingTranslator._default_*_fn methods

This is motivated by two main reasons:

  1. To keep get_asset_spec implementation as clean as possible in subsequent PR.
  2. DagsterSlingTranslator.get_* methods will be deprecated in a subsequent PR, but it would be great to keep to docstrings in the code after these will be removed, to help users if needed.

How I Tested These Changes

Existing tests with BK

Copy link
Contributor

@OwenKephart OwenKephart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me!

@maximearmstrong maximearmstrong force-pushed the maxime/sling-asset-spec-1 branch from 741906e to 63ae4eb Compare January 17, 2025 16:56
@maximearmstrong maximearmstrong force-pushed the maxime/sling-asset-spec-2 branch from 0dfb519 to a2508f5 Compare January 17, 2025 16:56
@@ -155,6 +194,32 @@ def get_deps_asset_key(self, stream_name: str) -> AssetKey:
return AssetKey(map[stream_name])

"""
return self._default_deps_fn(stream_definition)

def _default_deps_fn(self, stream_definition: Mapping[str, Any]) -> Iterable[AssetKey]:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type in the function signature is incorrect. The method accepts stream_definition: Mapping[str, Any] but the docstring still references stream_name: str. This should be updated to match the actual implementation and maintain consistency with the other translator methods.

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants