Andrew Smith
08/16/2022, 8:10 PMmulti_asset
for pulling them and storing them on disk. However, I'm not sure how I would feed those in to another asset without creating a unique asset for each table (not an option, as tables need to be defined in a yaml config file).sandy
08/16/2022, 10:01 PMAndrew Smith
08/16/2022, 10:46 PMn
number files. That is, without defining each table as its own asset.
Outside of dagster I would just loop through a list of table names, writing the tables to a temp directory, and then have another function load everything in said file. However, that doesn't feel dagsterish, and doesn't fit well with the asset driven design.sandy
08/16/2022, 10:48 PMAndrew Smith
08/17/2022, 4:20 PMdagster.StaticPartitionsDefinition
correct? There isn't really any examples or documentation on using this with assets. Would I more or less use it in the same fashion as shown with ops?
CONTINENTS = [
"Africa",
"Antarctica",
"Asia",
"Europe",
"North America",
"Oceania",
"South America",
]
@static_partitioned_config(partition_keys=CONTINENTS)
def continent_config(partition_key: str):
return {"ops": {"continent_op": {"config": {"continent_name": partition_key}}}}
@op(config_schema={"continent_name": str})
def continent_op(context):
<http://context.log.info|context.log.info>(context.op_config["continent_name"])
@job(config=continent_config)
def continent_job():
continent_op()
sandy
08/17/2022, 4:21 PMDailyPartitionsDefinition(start_date=...)
with StaticPartitionsDefinition(CONTINENTS)
Andrew Smith
08/17/2022, 4:22 PM