try:
folder = pd.Series(df.logical_key.dropna().str.extract("([^/]+/?).*")[0].unique())
prefixes = folder[folder.str.endswith("/")].sort_values().tolist()
objects = folder[~folder.str.endswith("/")].sort_values().tolist()
except AttributeError:
// Pandas will raise an attribute error if the DataFrame has
// no rows with a non-null logical_key. We expect that case if
After Change
["physical_key"],
axis=1
).to_dict(orient="records")
objects = folder[~folder.logical_key.str.contains("/")].to_dict(orient="records")
except AttributeError as err:
// Pandas will raise an attribute error if the DataFrame has
// no rows with a non-null logical_key. We expect that case if