Skip to content

Extract DagsterInstance factory methods into separate module #31611

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 7, 2025

Conversation

schrockn
Copy link
Member

@schrockn schrockn commented Aug 7, 2025

Summary & Motivation

Extract DagsterInstance factory methods into a dedicated factory.py module to improve code organization and maintainability. The refactoring moves all instance creation logic from the main DagsterInstance class into standalone factory functions while preserving the existing public API.

The new factory module includes functions for creating ephemeral instances, instances from DAGSTER_HOME, local temporary instances, and instances from configuration. The public static methods on DagsterInstance now delegate to these factory functions.

from dagster._core.instance.factory import create_ephemeral_instance
# DagsterInstance.ephemeral() now calls create_ephemeral_instance()

How I Tested These Changes

Existing test suite.

@schrockn schrockn changed the title factory Extract DagsterInstance factory methods into separate module Aug 7, 2025
@schrockn schrockn requested a review from OwenKephart August 7, 2025 04:01
@schrockn schrockn marked this pull request as ready for review August 7, 2025 04:01
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from 20ed54e to 2f76743 Compare August 7, 2025 05:18
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from 2f76743 to c0c8346 Compare August 7, 2025 12:04
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from c0c8346 to d91a8cf Compare August 7, 2025 13:32
@schrockn schrockn changed the base branch from schrockn/ir-1 to graphite-base/31611 August 7, 2025 13:48
@schrockn schrockn changed the base branch from graphite-base/31611 to schrockn/ir-1 August 7, 2025 14:06
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from d91a8cf to 3d156ec Compare August 7, 2025 15:43
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from 3d156ec to 50d15f1 Compare August 7, 2025 16:29
Copy link
Member Author

schrockn commented Aug 7, 2025

Merge activity

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

@schrockn schrockn changed the base branch from schrockn/ir-1 to graphite-base/31611 August 7, 2025 17:12
@schrockn schrockn changed the base branch from graphite-base/31611 to master August 7, 2025 17:14
@schrockn schrockn force-pushed the schrockn/ir-2-factory branch from 50d15f1 to c0e0735 Compare August 7, 2025 17:16
@schrockn schrockn merged commit d80fa6b into master Aug 7, 2025
4 of 5 checks passed
@schrockn schrockn deleted the schrockn/ir-2-factory branch August 7, 2025 17:18
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