Skip to content

Extract asset-related methods from DagsterInstance into AssetMixin #31619

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

Merged
merged 1 commit into from
Aug 8, 2025

Conversation

schrockn
Copy link
Member

@schrockn schrockn commented Aug 7, 2025

Summary & Motivation

Extracted all asset-related methods from the DagsterInstance class into a new AssetMixin class to improve code organization and maintainability. This follows the existing pattern used by other mixins like SettingsMixin, RunsMixin, and DomainsMixin.

The refactoring moves approximately 80 asset-related methods from instance.py to the new asset_mixin.py file, including:

  • Asset key management (get_asset_keys, has_asset_key, all_asset_keys)
  • Asset materialization and observation fetching
  • Asset status cache operations
  • Asset health state queries
  • Asset partition status methods

The DagsterInstance class now inherits from AssetMixin to maintain full backward compatibility.

How I Tested These Changes

Existing test suite covers all moved methods.

Changelog

Refactoring: Extracted asset-related methods from DagsterInstance into new AssetMixin class for improved code organization. No breaking changes to public API.

@schrockn schrockn changed the title cp Extract asset-related methods from DagsterInstance into AssetMixin Aug 7, 2025
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from c8256a3 to 0b9e343 Compare August 7, 2025 13:24
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 4e7d7ef to a39d5fd Compare August 7, 2025 13:32
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 0b9e343 to b04e9ec Compare August 7, 2025 13:32
@schrockn schrockn marked this pull request as ready for review August 7, 2025 13:36
@schrockn schrockn force-pushed the schrockn/asset-mixin branch 2 times, most recently from 0039e52 to aa59675 Compare August 7, 2025 15:13
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from e2ea392 to 3d04cb3 Compare August 7, 2025 15:13
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from aa59675 to 5897b3c Compare August 7, 2025 15:43
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch 2 times, most recently from 4c6cb29 to e9d7f54 Compare August 7, 2025 16:29
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 5897b3c to 440381f Compare August 7, 2025 16:29
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from e9d7f54 to cf2f360 Compare August 7, 2025 17:23
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 440381f to 0d8fe89 Compare August 7, 2025 17:23
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from cf2f360 to fcd94eb Compare August 7, 2025 18:17
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 0d8fe89 to efefbde Compare August 7, 2025 18:17
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from efefbde to 9d7d1cc Compare August 7, 2025 22:11
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from fcd94eb to 45746e9 Compare August 7, 2025 22:11
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 352877e to 1acb5b1 Compare August 8, 2025 12:49
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 3c0c4a3 to 7340d93 Compare August 8, 2025 14:43
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 1acb5b1 to 0aa2ff9 Compare August 8, 2025 14:43
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 7340d93 to 938c463 Compare August 8, 2025 15:07
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 0aa2ff9 to 1729a13 Compare August 8, 2025 15:07
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 938c463 to bf4d8c7 Compare August 8, 2025 17:44
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 1729a13 to 5f1eccb Compare August 8, 2025 17:44
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 5f1eccb to 664b684 Compare August 8, 2025 17:51
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from bf4d8c7 to 84e8f70 Compare August 8, 2025 17:51
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 664b684 to ee2aa69 Compare August 8, 2025 19:51
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from ce6565c to 61ec23c Compare August 8, 2025 19:51
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 61ec23c to 27b7053 Compare August 8, 2025 20:23
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from ee2aa69 to 8c84d34 Compare August 8, 2025 20:23
@schrockn schrockn requested a review from OwenKephart August 8, 2025 20:31
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 27b7053 to 520ac48 Compare August 8, 2025 21:03
@schrockn schrockn force-pushed the schrockn/ir-8-create-mixins-folder branch from 8c84d34 to 81e05b1 Compare August 8, 2025 21:03
Copy link
Member Author

schrockn commented Aug 8, 2025

Merge activity

  • Aug 8, 10:14 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Aug 8, 10:18 PM UTC: Graphite rebased this pull request as part of a merge.
  • Aug 8, 10:19 PM UTC: @schrockn merged this pull request with Graphite.

@schrockn schrockn changed the base branch from schrockn/ir-8-create-mixins-folder to graphite-base/31619 August 8, 2025 22:15
@schrockn schrockn changed the base branch from graphite-base/31619 to master August 8, 2025 22:16
This refactoring moves approximately 80 asset-related methods from the DagsterInstance
class into a new AssetMixin class to improve code organization and maintainability.
The change follows the existing pattern used by other mixins like SettingsMixin,
RunsMixin, and DomainsMixin.

Key changes:
- Created new AssetMixin class containing all asset-related methods
- Updated DagsterInstance to inherit from AssetMixin for backward compatibility
- Cleaned up imports in instance.py
- Maintained all existing public APIs
@schrockn schrockn force-pushed the schrockn/asset-mixin branch from 520ac48 to f0cfb12 Compare August 8, 2025 22:17
@schrockn schrockn merged commit d4a0384 into master Aug 8, 2025
4 of 5 checks passed
@schrockn schrockn deleted the schrockn/asset-mixin branch August 8, 2025 22:19
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