Hello, is there a way to specify `partition_mappin...
# ask-community
j
Hello, is there a way to specify
partition_mapping
for
SourceAsset
like in
AssetIn
?
👀 1
^ sometimes says
metadata
and sometimes says
metadata_entries
p
Interested. e.g.
Copy code
@asset(ins={'some_asset': AssetIn(['some_asset'], partition_mapping=<syntax for a speciic partition?>))})
j
Yeah, although i believe
partition_mapping
should probably be an instance of PartitionMapping .
s
Hi Jeff - could you expand a little more on what you're trying to accomplish? Right now, PartitionMappings are typically placed on a downstream asset to specify the partition mapping works for the dependency on an upstream asset. However, SourceAssets have no upstream assets.
j
Hi Sandy, basically the issue is that I can’t figure out how to specify
PartitionMapping
for an upstream asset that is in a different repository/code location. From what I understand, when I specify the upstream, I am to use
SourceAsset
rather than
AssetIn
, but this does not have a
partition_mapping
argument.
s
ah - you can use both together:
Copy code
asset1 = SourceAsset("asset1", partitions_def=...)

@asset(ins={"asset1": AssetIn(partition_mapping=...)})
def asset2(asset1):
    ...
j
I see; that makes a lot of sense. Thanks!