Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Strand Lab
Strand Lab Cellxgene Gateway
Commits
b1ae9e8c
Commit
b1ae9e8c
authored
Apr 02, 2021
by
Alok Saldanha
Browse files
ensure s3 bucket does not include trailing slash
parent
76c1d9e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
cellxgene_gateway/items/s3/s3item_source.py
View file @
b1ae9e8c
...
...
@@ -29,6 +29,8 @@ class S3ItemSource(ItemSource):
):
self
.
_name
=
name
self
.
s3
=
s3fs
.
S3FileSystem
()
if
bucket
.
startswith
(
's3://'
):
raise
Exception
(
f
"Bucket name should not include s3:// prefix, got
{
bucket
}
"
)
self
.
bucket
=
bucket
self
.
h5ad_suffix
=
h5ad_suffix
self
.
annotation_dir_suffix
=
annotation_dir_suffix
...
...
@@ -67,7 +69,7 @@ class S3ItemSource(ItemSource):
raise
Exception
(
f
"S3 url '
{
url
}
' does not exist."
)
s3key_map
=
dict
(
(
filepath
[
len
(
self
.
bucket
)
:],
"s3://"
+
filepath
)
(
filepath
[
len
(
self
.
bucket
)
:]
.
lstrip
(
'/'
)
,
"s3://"
+
filepath
)
for
filepath
in
sorted
(
self
.
s3
.
ls
(
url
))
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment