-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Refactor DagsterInstance into structured mixins architecture #31617
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 7, 2025
1193b2e
to
f37cf5e
Compare
1dfda41
to
3ad4f5f
Compare
f37cf5e
to
693814a
Compare
3ad4f5f
to
4e7d7ef
Compare
This was referenced Aug 7, 2025
4e7d7ef
to
a39d5fd
Compare
693814a
to
9ef6e80
Compare
9ef6e80
to
14b9e13
Compare
e2ea392
to
3d04cb3
Compare
14b9e13
to
8b593f4
Compare
3d04cb3
to
4c6cb29
Compare
8b593f4
to
f4ee657
Compare
4c6cb29
to
e9d7f54
Compare
f4ee657
to
9054ada
Compare
e9d7f54
to
cf2f360
Compare
9054ada
to
db9c8a6
Compare
1acb5b1
to
0aa2ff9
Compare
0aa2ff9
to
1729a13
Compare
0a54a72
to
3428363
Compare
1729a13
to
5f1eccb
Compare
5f1eccb
to
664b684
Compare
3428363
to
4e46164
Compare
664b684
to
ee2aa69
Compare
This was referenced Aug 8, 2025
OwenKephart
approved these changes
Aug 8, 2025
88e2f93
to
618c24f
Compare
ee2aa69
to
8c84d34
Compare
8c84d34
to
81e05b1
Compare
81e05b1
to
0be8336
Compare
This was referenced Aug 8, 2025
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
This PR creates a structured mixins architecture for
DagsterInstance
to improve code organization and maintainability. The massiveDagsterInstance
class (over 1400 lines) is reorganized by extracting functionality into focused mixin classes.Key changes:
python_modules/dagster/dagster/_core/instance/mixins/
directory for organized mixin classesdomains_mixin.py
to the new mixins package with improved type safety usingcast()
DagsterInstance
into dedicatedRunsMixin
, including:get_run_by_id
,get_run_record_by_id
)create_run
,create_run_for_job
)add_run
,delete_run
,handle_run_event
)launch_run
,submit_run
,resume_run
)report_run_canceling
,report_run_failed
)DagsterInstance
now inherits fromSettingsMixin
,RunsMixin
,DynamicPartitionsStore
, andDomainsMixin
The mixins follow the established architectural pattern where simple implementations delegate to domain objects for complex business logic, maintaining clean separation of concerns while improving code organization.
How I Tested These Changes
Verified that all imports resolve correctly and existing functionality is preserved through the delegation pattern. The reorganization maintains the same public API surface area.