mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-08 06:48:12 +08:00
fix: s3 user annotations (#2541)
do _not_ attempt to create the user annotations directory if an s3 location is specified
This commit is contained in:
@@ -4,6 +4,7 @@ from os.path import splitext, isdir
|
|||||||
from server.common.annotations.local_file_csv import AnnotationsLocalFile
|
from server.common.annotations.local_file_csv import AnnotationsLocalFile
|
||||||
from server.common.config.base_config import BaseConfig
|
from server.common.config.base_config import BaseConfig
|
||||||
from server.common.errors import ConfigurationError, AnnotationsError
|
from server.common.errors import ConfigurationError, AnnotationsError
|
||||||
|
from server.common.utils.data_locator import DataLocator
|
||||||
from server.data_common.matrix_loader import MatrixDataLoader
|
from server.data_common.matrix_loader import MatrixDataLoader
|
||||||
|
|
||||||
|
|
||||||
@@ -127,11 +128,15 @@ class DatasetConfig(BaseConfig):
|
|||||||
if lf_ext and lf_ext != ".csv":
|
if lf_ext and lf_ext != ".csv":
|
||||||
raise ConfigurationError(f"genesets file type must be .csv: {genesets_filename}")
|
raise ConfigurationError(f"genesets file type must be .csv: {genesets_filename}")
|
||||||
|
|
||||||
if dirname is not None and not isdir(dirname):
|
if dirname is not None:
|
||||||
try:
|
if not DataLocator(dirname).islocal():
|
||||||
os.mkdir(dirname)
|
# remote object stores only support objects but not directories, do nothing
|
||||||
except OSError:
|
pass
|
||||||
raise ConfigurationError("Unable to create directory specified by --user-generated-data-dir")
|
elif not isdir(dirname):
|
||||||
|
try:
|
||||||
|
os.mkdir(dirname)
|
||||||
|
except OSError:
|
||||||
|
raise ConfigurationError("Unable to create directory specified by --user-generated-data-dir")
|
||||||
|
|
||||||
anno_config = {
|
anno_config = {
|
||||||
"user-annotations": self.user_annotations__enable,
|
"user-annotations": self.user_annotations__enable,
|
||||||
|
|||||||
Reference in New Issue
Block a user