https://dagster.io/ logo
#dagster-support
Title
# dagster-support
d

Daniel Gafni

07/12/2022, 3:35 PM
I've got issues loading an asset partition into a non-partitined asset... The attribute
.upstream_output.has_asset_partitions
of the
InputContext
in the IO Manager is for some reason set to
False
. I can't access the upstream partitions. This happens even if I try to materialize the non-partitioned asset as a part of a partitioned job including the both assets. Is this intended?
y

yuhan

07/12/2022, 7:48 PM
cc @sandy
s

sandy

07/12/2022, 10:32 PM
does
context.has_asset_partitions
work? (i.e. no
upstream_output
)
d

Daniel Gafni

07/13/2022, 3:24 PM
it's
False
too
s

sandy

07/14/2022, 6:48 PM
This change, which is going out in today's release, should address this issue: https://github.com/dagster-io/dagster/pull/8866
👍 1
d

Daniel Gafni

07/18/2022, 10:37 AM
Some feedback: 1.
context.asset_partitions_def
is only accessible from the IO Manager context, not from the
OPExecutionContext
(in the
@asset
decorator) 2. I still can't get the exact partitions (keys) set. I can access the
context.asset_partitions_def.get_partition_keys()
method, but it requires passing
current_time
. I can get it from
context.asset_partition_key
, but I'm not sure if this is a good general solution. What would be your advise here?
s

sandy

07/18/2022, 4:17 PM
1. Here's a PR for making them accessible on the op context: https://github.com/dagster-io/dagster/pull/8924 2.
current_time
is Optional on
get_partition_keys
- in general, it doesn't need to be passed
d

Daniel Gafni

07/18/2022, 6:19 PM
I see. The result will always be correct even for "old" runs like backfills or materializations for assets in the past? Edit: just checked this, it does return future partitions for runs in the past. I would like to get the mapped partitions for this specific run.
s

sandy

07/19/2022, 12:29 AM
Ah I see. Here's a PR for adding the ability to get only the partitions within a range: https://github.com/dagster-io/dagster/pull/8933#pullrequestreview-1042602994
👍 1
2 Views