man-group / ArcticDB

ArcticDB is a high performance, serverless DataFrame database built for the Python Data Science ecosystem.
http://arcticdb.io
Other
1.46k stars 93 forks source link

You can create invalid library names with Mongo backend #1655

Open jamesmunro opened 3 months ago

jamesmunro commented 3 months ago

Describe the bug

ArcticDB lets me create an unusable library with a / on MongoDB backend. / is not a valid char for a Mongo database name.

Steps/Code to Reproduce

import numpy as np
import arcticdb as adb

arctic = adb.Arctic('mongodb://localhost:27017')
a.create_library('a/b')
lib = a.get_library('a/b')
lib.write('c', np.array([1, 2, 3]))

Fails with

StorageException: E_UNEXPECTED_MONGO_ERROR Unexpected Mongo Error: MongoError#73: mongodb generic server error Invalid database name: 'arcticc_a/b': generic server error

Expected Results

create_library should fail instead

OS, Python Version and ArcticDB Version

Python: 3.11.9 | packaged by conda-forge | (main, Apr 19 2024, 18:36:13) [GCC 12.3.0]
OS: Linux-5.15.0-101-generic-x86_64-with-glibc2.35
ArcticDB: 4.4.2

Backend storage used

Mongo

Additional Context

No response