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

[pythonic resources] never treat partial resources as resolved #27210

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

benpankow
Copy link
Member

@benpankow benpankow commented Jan 17, 2025

Summary

The implementation of _is_fully_configured previously would mark partial/configure-at-runtime resources as fully populated if all values had defaults. This means the config values couldn't be overridden at runtime properly.

This PR ensures that partial/configure-at-runtime resources can always have fields overridden at runtime.

Test Plan

Previously failing unit test.

@benpankow
Copy link
Member Author

benpankow commented Jan 17, 2025

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

@@ -965,3 +965,64 @@ def my_asset(outer: MyBoringOuterResource) -> str:
"my_asset",
"SetupTeardownInnerResource yield_for_execution done",
]


def test_nested_resources_runtime_config_fully_populated() -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

describe test case in docstring pls

Comment on lines 971 to 981
class CredentialsResource(ConfigurableResource):
username: str = "default_username"
password: str = "default_password"

class DBConfigResource(ConfigurableResource):
creds: CredentialsResource
host: str = "default_host"
database: str = "default_database"

class DBResource(ConfigurableResource):
config: DBConfigResource
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think it would be a bit more clear to make the names reference what we're testing (IE top level resource, nested resource, further nested resource etc

Copy link
Contributor

@dpeng817 dpeng817 left a comment

Choose a reason for hiding this comment

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

Noice. thanks

@benpankow benpankow force-pushed the benpankow/never-treat-partial-resources-as-resolved branch from e19c5ee to ef85376 Compare January 22, 2025 07:43
@benpankow benpankow requested a review from neverett as a code owner January 22, 2025 07:43
@benpankow benpankow changed the base branch from benpankow/pythonic-config-nesting-defaults-2 to master January 22, 2025 07:43
Copy link

Deploy preview for dagster-university ready!

✅ Preview
https://dagster-university-ldz0yfls2-elementl.vercel.app
https://benpankow-never-treat-partial-resources-as-resolved.dagster-university.dagster-docs.io

Built with commit ef85376.
This pull request is being automatically deployed with vercel-action

Copy link

Deploy preview for dagster-docs-beta ready!

Preview available at https://dagster-docs-beta-oheofb5va-elementl.vercel.app

Direct link to changed pages:

@benpankow benpankow merged commit 1c3c88e into master Jan 22, 2025
5 checks passed
@benpankow benpankow deleted the benpankow/never-treat-partial-resources-as-resolved branch January 22, 2025 17:00
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