diff --git a/argilla-server/.env.dev b/argilla-server/.env.dev index 4935d33ed7..d3ab4d5fe2 100644 --- a/argilla-server/.env.dev +++ b/argilla-server/.env.dev @@ -1,4 +1,4 @@ OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES # Needed by RQ to work with forked processes on MacOS ALEMBIC_CONFIG=src/argilla_server/alembic.ini ARGILLA_AUTH_SECRET_KEY=8VO7na5N/jQx+yP/N+HlE8q51vPdrxqlh6OzoebIyko= # With this we avoid using a different key every time the server is reloaded -ARGILLA_DATABASE_URL=sqlite+aiosqlite:///${HOME}/.argilla/argilla-dev.db?check_same_thread=False +ARGILLA_DATABASE_URL=sqlite+aiosqlite:///${HOME}/.argilla/argilla-dev.db diff --git a/argilla-server/.env.test b/argilla-server/.env.test index 55d04fe762..cb4e68b215 100644 --- a/argilla-server/.env.test +++ b/argilla-server/.env.test @@ -1,2 +1,2 @@ -ARGILLA_DATABASE_URL=sqlite+aiosqlite:///${HOME}/.argilla/argilla-test.db?check_same_thread=False +ARGILLA_DATABASE_URL=sqlite+aiosqlite:///${HOME}/.argilla/argilla-test.db ARGILLA_REDIS_URL=redis://localhost:6379/1 # Using a different Redis database for testing diff --git a/argilla-server/src/argilla_server/settings.py b/argilla-server/src/argilla_server/settings.py index 52415cd6f3..dfd83143d4 100644 --- a/argilla-server/src/argilla_server/settings.py +++ b/argilla-server/src/argilla_server/settings.py @@ -187,7 +187,7 @@ def set_database_url(cls, database_url: str, info: ValidationInfo) -> str: if not database_url: home_path = info.data.get("home_path") sqlite_file = os.path.join(home_path, "argilla.db") - return f"sqlite+aiosqlite:///{sqlite_file}?check_same_thread=False" + return f"sqlite+aiosqlite:///{sqlite_file}" if "sqlite" in database_url: regex = re.compile(r"sqlite(?!\+aiosqlite)") diff --git a/argilla-server/tests/unit/commons/test_settings.py b/argilla-server/tests/unit/commons/test_settings.py index 14c2d27799..b2ba231c9f 100644 --- a/argilla-server/tests/unit/commons/test_settings.py +++ b/argilla-server/tests/unit/commons/test_settings.py @@ -38,7 +38,7 @@ def test_settings_default_database_url(monkeypatch): settings = Settings() - assert settings.database_url == f"sqlite+aiosqlite:///{settings.home_path}/argilla.db?check_same_thread=False" + assert settings.database_url == f"sqlite+aiosqlite:///{settings.home_path}/argilla.db" @pytest.mark.parametrize(