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

elim unnecessary local vars #22496

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,6 @@ def my_asset(my_upstream_asset: int) -> int:

from dagster._config.pythonic_config import validate_resource_annotated_function

compute_kind = check.opt_str_param(compute_kind, "compute_kind")
required_resource_keys = check.opt_set_param(required_resource_keys, "required_resource_keys")
upstream_asset_deps = (
_deps_and_non_argument_deps_to_asset_deps(deps=deps, non_argument_deps=non_argument_deps)
or []
)
resource_defs = dict(check.opt_mapping_param(resource_defs, "resource_defs"))

check.invariant(
not (io_manager_key and io_manager_def),
"Both io_manager_key and io_manager_def were provided to `@asset` decorator. Please"
Expand Down Expand Up @@ -325,7 +317,7 @@ def my_asset(my_upstream_asset: int) -> int:
resource_related_state = ResourceRelatedState(
io_manager_def=io_manager_def,
io_manager_key=io_manager_key,
resources=resource_defs,
resources=dict(check.opt_mapping_param(resource_defs, "resource_defs")),
out_asset_key=out_asset_key,
)

Expand All @@ -340,8 +332,10 @@ def my_asset(my_upstream_asset: int) -> int:
code_version=code_version,
op_tags=op_tags,
config_schema=config_schema,
compute_kind=compute_kind,
required_resource_keys=required_resource_keys,
compute_kind=check.opt_str_param(compute_kind, "compute_kind"),
required_resource_keys=check.opt_set_param(
required_resource_keys, "required_resource_keys"
),
op_def_resource_defs=resource_related_state.op_resource_defs,
assets_def_resource_defs=resource_related_state.asset_resource_defs,
backfill_policy=backfill_policy,
Expand All @@ -362,7 +356,10 @@ def my_asset(my_upstream_asset: int) -> int:
tags=validate_tags_strict(args.tags),
)
},
upstream_asset_deps=upstream_asset_deps,
upstream_asset_deps=_deps_and_non_argument_deps_to_asset_deps(
deps=deps, non_argument_deps=non_argument_deps
)
or [],
asset_in_map=ins or {},
# We will not be using specs to construct here
# because they are assumption about output names. Non-spec
Expand Down