Skip to content

Commit

Permalink
handle selector properly
Browse files Browse the repository at this point in the history
  • Loading branch information
benpankow committed Jan 17, 2025
1 parent 67eb8f5 commit 92a85c2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Field,
Selector,
)
from dagster._config.config_type import Array, ConfigType, Noneable
from dagster._config.config_type import Array, ConfigType, ConfigTypeKind, Noneable
from dagster._config.field_utils import (
FIELD_NO_DEFAULT_PROVIDED,
Map,
Expand Down Expand Up @@ -55,9 +55,13 @@ def _apply_defaults_to_schema_field(old_field: Field, additional_default_values:
new_default = (
old_field.default_value if old_field.default_provided else FIELD_NO_DEFAULT_PROVIDED
)

if all(
sub_field.default_provided or not sub_field.is_required
for sub_field in updated_sub_fields.values()
) or (
old_field.config_type.kind == ConfigTypeKind.SELECTOR
and any(sub_field.default_provided for sub_field in updated_sub_fields.values())
):
new_default = {
**additional_default_values,
Expand Down

0 comments on commit 92a85c2

Please sign in to comment.