Skip to content

Commit

Permalink
fix: s3 user annotations (#2541)
Browse files Browse the repository at this point in the history
do _not_ attempt to create the user annotations directory if an s3 location is specified
  • Loading branch information
atolopko-czi authored Jul 28, 2022
1 parent 69a6d52 commit 4df50a7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions server/common/config/dataset_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from server.common.annotations.local_file_csv import AnnotationsLocalFile
from server.common.config.base_config import BaseConfig
from server.common.errors import ConfigurationError, AnnotationsError
from server.common.utils.data_locator import DataLocator
from server.data_common.matrix_loader import MatrixDataLoader


Expand Down Expand Up @@ -127,11 +128,15 @@ def handle_local_file_csv_annotations(self, context):
if lf_ext and lf_ext != ".csv":
raise ConfigurationError(f"genesets file type must be .csv: {genesets_filename}")

if dirname is not None and not isdir(dirname):
try:
os.mkdir(dirname)
except OSError:
raise ConfigurationError("Unable to create directory specified by --user-generated-data-dir")
if dirname is not None:
if not DataLocator(dirname).islocal():
# remote object stores only support objects but not directories, do nothing
pass
elif not isdir(dirname):
try:
os.mkdir(dirname)
except OSError:
raise ConfigurationError("Unable to create directory specified by --user-generated-data-dir")

anno_config = {
"user-annotations": self.user_annotations__enable,
Expand Down

0 comments on commit 4df50a7

Please sign in to comment.