Analysis get_best_checkpoint returning None

I’m having trouble when trying to retrieve the trial best checkpoint, this is an example inside the training loop where I’m checkpointing my metrics

metrics = {"loss": val_loss, "running_loss": running_loss}
            with tune.checkpoint_dir(epoch) as checkpoint_dir:
                path = os.path.join(checkpoint_dir, "checkpoint")
      , optimizer.state_dict()), path)
                with open(path, "w") as f:

when tryind result.get_best_checkpoint it returns None, what am I doing wrong?