mirror of
https://github.com/tiqi-group/pydase_service_base.git
synced 2026-02-16 08:08:49 +01:00
Add influxDbv3Session into database init
This commit is contained in:
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING
|
||||
if TYPE_CHECKING:
|
||||
from .influxdb_session import InfluxDBSession # type: ignore
|
||||
from .influxdbv1_session import InfluxDBv1Session # type: ignore
|
||||
from .influxdbv3_session import InfluxDBv3Session # type: ignore
|
||||
from .postgres_session import PostgresDatabaseSession # type: ignore
|
||||
else:
|
||||
|
||||
@@ -34,7 +35,18 @@ else:
|
||||
"InfluxDBv1Session requires the 'influxdbv1' extra. "
|
||||
"Please refer to https://gitlab.phys.ethz.ch/tiqi-projects/qchub/icon-services/pydase_service_base."
|
||||
)
|
||||
try:
|
||||
import influxdb_client_3 # type: ignore # noqa
|
||||
|
||||
from .influxdbv3_session import InfluxDBv3Session # type: ignore
|
||||
except ImportError:
|
||||
|
||||
class InfluxDBv3Session: # type: ignore
|
||||
def __init__(self) -> None:
|
||||
raise OptionalDependencyError(
|
||||
"InfluxDBv3Session requires the 'influxdbv3' extra. "
|
||||
"Please refer to https://gitlab.phys.ethz.ch/tiqi-projects/qchub/icon-services/pydase_service_base."
|
||||
)
|
||||
try:
|
||||
import sqlmodel # noqa
|
||||
|
||||
@@ -49,4 +61,4 @@ else:
|
||||
)
|
||||
|
||||
|
||||
__all__ = ["InfluxDBSession", "InfluxDBv1Session", "PostgresDatabaseSession"]
|
||||
__all__ = ["InfluxDBSession", "InfluxDBv1Session", "InfluxDBv3Session", "PostgresDatabaseSession"]
|
||||
|
||||
Reference in New Issue
Block a user