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

[dagster-airlift][federation-apis] federation APIs accumulator #25857

Merged
merged 4 commits into from
Nov 15, 2024

Conversation

dpeng817
Copy link
Contributor

@dpeng817 dpeng817 commented Nov 12, 2024

This PR is now being used to accumulate federation API commits before landing.
ORIGINAL DESCRIPTION:

Summary & Motivation

Right now, all airlift internals which operate over mapped airflow assets take in a fully-qualified Definitions object. This PR changes them to instead operate over an iterable of assets, and leaves the definitions munging to the callsites.

After making this change, it becomes easy to add asset-oriented airlift methods - and I demonstrate that with a standalone method to enrich airflow assets. We'll eventually be able to re-implement the full defs loader on top of this.

How I Tested These Changes

New test for the new method, existing test suite.

Changelog

NOCHANGELOG

Copy link
Contributor Author

dpeng817 commented Nov 12, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dpeng817 dpeng817 changed the title [dagster-airlift] enrich mapped assets [dagster-airlift] asset-ify airlift internals Nov 12, 2024
@dpeng817 dpeng817 changed the title [dagster-airlift] asset-ify airlift internals [dagster-airlift] asset-ify airlift internals + standalone asset enrichment method. Nov 12, 2024
@dpeng817 dpeng817 marked this pull request as ready for review November 12, 2024 00:09
@dpeng817 dpeng817 force-pushed the dpeng817/move_out_examples branch from 924767f to 9c3d3d3 Compare November 12, 2024 17:33
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch from 3b23857 to ca0b0d6 Compare November 13, 2024 22:02
@dpeng817 dpeng817 force-pushed the dpeng817/move_tutorial branch from 18e94a9 to ba5b005 Compare November 13, 2024 22:17
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch from ca0b0d6 to 0f431c5 Compare November 13, 2024 22:17
@dpeng817 dpeng817 force-pushed the dpeng817/move_tutorial branch from ba5b005 to a3fe72d Compare November 13, 2024 23:18
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch 2 times, most recently from 6e8a029 to 252e061 Compare November 13, 2024 23:43
@dpeng817 dpeng817 changed the base branch from dpeng817/move_tutorial to graphite-base/25857 November 13, 2024 23:44
@dpeng817 dpeng817 force-pushed the graphite-base/25857 branch from a3fe72d to dcdf600 Compare November 13, 2024 23:45
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch from 252e061 to 66d03ae Compare November 13, 2024 23:45
@dpeng817 dpeng817 changed the base branch from graphite-base/25857 to master November 13, 2024 23:45
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch 2 times, most recently from 790dad2 to 46df90c Compare November 13, 2024 23:46
Copy link
Member

@benpankow benpankow left a comment

Choose a reason for hiding this comment

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

q on some of the type signatures, otherwise lgtm

@@ -36,7 +37,7 @@
@dataclass
class AirflowInstanceDefsLoader(StateBackedDefinitionsLoader[SerializedAirflowDefinitionsData]):
airflow_instance: AirflowInstance
explicit_defs: Definitions
mapped_assets: Iterable[MappedAsset]
Copy link
Member

Choose a reason for hiding this comment

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

could we use Sequence instead of Iterable across this PR? doesn't seem like we have a strong reason to make it Iterable & Sequence is more consistent across other parts of codebase

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea I buy this.

def enrich_airflow_mapped_assets(
mapped_assets: Iterable[MappedAsset],
airflow_instance: AirflowInstance,
) -> Sequence[AssetsDefinition]:
Copy link
Member

Choose a reason for hiding this comment

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

do we know that the outputs here are AssetsDefinition, since the input could be specs?

Copy link
Member

Choose a reason for hiding this comment

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

oh I see, _apply_airflow_data_to_specs forcibly definition-izes the specs, makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup

@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch from 46df90c to e9d165b Compare November 14, 2024 19:44
@dpeng817 dpeng817 changed the title [dagster-airlift][federation-apis] asset-ify airlift internals + standalone asset enrichment method. [dagster-airlift][federation-apis] federation APIs accumulator Nov 14, 2024
@dpeng817 dpeng817 force-pushed the dpeng817/enrich_mapped_assets branch from e9d165b to 5e8ff6d Compare November 14, 2024 22:53
@graphite-app graphite-app bot added the docs-to-migrate Docs to migrate to new docs site label Nov 14, 2024
Copy link

Deploy preview for dagster-docs ready!

Preview available at https://dagster-docs-r7d52yv93-elementl.vercel.app
https://dpeng817-enrich-mapped-assets.dagster.dagster-docs.io

Direct link to changed pages:

Copy link

graphite-app bot commented Nov 14, 2024

Graphite Automations

"Add a 'docs-to-migrate' label to PRs with docs" took an action on this PR • (11/14/24)

1 label was added to this PR based on Christopher DeCarolis's automation.

Copy link
Contributor Author

dpeng817 commented Nov 15, 2024

Merge activity

  • Nov 14, 5:05 PM PST: A user started a stack merge that includes this pull request via Graphite.
  • Nov 14, 5:06 PM PST: A user merged this pull request with Graphite.

@dpeng817 dpeng817 merged commit 8cdc4dc into master Nov 15, 2024
2 of 5 checks passed
@dpeng817 dpeng817 deleted the dpeng817/enrich_mapped_assets branch November 15, 2024 01:06
@neverett neverett removed the docs-to-migrate Docs to migrate to new docs site label Jan 19, 2025
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.

3 participants