In DBFS, the checkpoint directory is automatically created when you set it using spark.sparkContext.setCheckpointDir(checkpoint_dir). This means that you do not need to explicitly create the directory beforehand using dbutils.fs.mkdirs(checkpoint_dir).
However, when using ABFSS, the directory does not get created automatically. You need to explicitly create the checkpoint directory using dbutils.fs.mkdirs(checkpoint_dir) before setting it with spark.sparkContext.setCheckpointDir(checkpoint_dir). This ensures that the directory exists and is accessible, which is why including dbutils.fs.mkdirs(checkpoint_dir) in the same cell is necessary for ABFSS but not for DBFS.