I've used Pathlib.Path().parent to get to a parent directory of a filepath.
This is because at runtime this can create an unpredictable number of paths, due to splitting on content.
The use of Pathlib.Path on a gs://... address removes the double //
cloudpathlib interprets a gs:/... prefix to be a local path, and can't open the requested file path as a local file
Result was that for the cohorts we now split (due to being... massive) we now write the main and latest report, then the report generation script breaks, so we don't get the mini-reports
I've used Pathlib.Path().parent to get to a parent directory of a filepath.
This is because at runtime this can create an unpredictable number of paths, due to splitting on content.
gs://...
address removes the double//
gs:/...
prefix to be a local path, and can't open the requested file path as a local file