trevenrawr
03/29/2022, 11:34 PMdynamic_partitioned_config
and am curious if there’s a generally-accepted way of passing richer information to the partition config generation function than a parition_key
can contain on its own. The old Partition
class was a nice wrapper that allowed for a key or display name to be paired with rich information that could be used to configure a partitioned run, but it seems like the new paradigm makes the key and the information one and the same. (Oh, it looks like Partition
is still in use internally but only the name is returned; any particular reason not to open that back up?)PartitionedConfig
since DynamicPartitionsDefinition
seems to allow for a partition_fn
that returns `Partition`s instead of strings… Giving that a go!prha
03/29/2022, 11:58 PMtrevenrawr
03/30/2022, 12:07 AMdef partition_fn(_current_time):
job_configs = build_job_configs()
return [Partition(job_config, f"{job_config.tenant}-{job_config.env}") for job_config in job_configs]
def run_conf_fn(partition):
job_config = partition.value
return make_run_config(job_config)
return PartitionedConfig(
partitions_def=DynamicPartitionsDefinition(partition_fn),
run_config_for_partition_fn=run_conf_fn,
decorated_fn=run_conf_fn,
)
I know the internal APIs aren’t really meant for external use, but it’s not entirely clear to me why the PartitionedConfig
needs a run_config_for_partition_fn
and also a decorated_fn
when the same function works for both.prha
03/30/2022, 9:37 PM