Alex Pavlides
04/18/2024, 9:02 AMElijah Ben Izzy
04/18/2024, 1:07 PMElijah Ben Izzy
04/18/2024, 1:28 PMonly_use_ray_if_decorated
(with a better name, then change this line to respect it, running locally if we haven’t gotten anything from the ray decorator: https://github.com/DAGWorks-Inc/hamilton/blob/d89b03e059143eb9581c50b624265185848ca782/hamilton/plugins/h_ray.py#L122. It feels like a nice extension.
We also have the task-based orchestration which can help group/assign different ones, but its a bit more complex.Alex Pavlides
04/18/2024, 1:36 PM@main.command()
def run():
if config["ray_backend"]:
output_type = h_ray.RayGraphAdapter(result_builder=base.PandasDataFrameResult())
else:
output_type = base.SimplePythonDataFrameGraphAdapter()
logger_hook = lifecycle.default.PrintLn(print_fn=<http://logger.info|logger.info>)
dr = (
driver.Builder()
.with_modules(
pipe_load_data,
pipe_prep_data,
pipe_entity_features,
pipe_add_features,
pipe_risk_metric,
)
.with_config(config)
.with_adapters(logger_hook, output_type)
.build()
)
Alex Pavlides
04/18/2024, 1:37 PMAlex Pavlides
04/18/2024, 1:37 PMElijah Ben Izzy
04/18/2024, 1:38 PMElijah Ben Izzy
04/18/2024, 1:39 PMAlex Pavlides
04/18/2024, 1:45 PMElijah Ben Izzy
04/18/2024, 1:46 PM