diff --git a/pyathena/filesystem/s3.py b/pyathena/filesystem/s3.py index bef26408..a4bdcbe1 100644 --- a/pyathena/filesystem/s3.py +++ b/pyathena/filesystem/s3.py @@ -283,7 +283,7 @@ def _ls_dirs( }, type=S3ObjectType.S3_OBJECT_TYPE_DIRECTORY, bucket=bucket, - key=c["Prefix"][:-1], + key=c["Prefix"][:-1].rstrip("/"), version_id=version_id, ) for c in response.get("CommonPrefixes", [])