A very clever person from StackOverflow assisted me in copying files to a directory from Databricks here: copyfiles
I am using the same principle to remove the files once it has been copied as shown in the link:
for i in range (0, len(files)):
file = files[i].name
if now in file:
dbutils.fs.rm(files[i].path,'/mnt/adls2/demo/target/' + file)
print ('copied ' + file)
else:
print ('not copied ' + file)
However, I'm getting the error:
TypeError: '/mnt/adls2/demo/target/' has the wrong type - class bool is expected.
Can someone let me know how to fix this. I thought it would be simple matter of removing the file after originally copying it using command dbutils.fs.rm