mirror of
https://github.com/tiqi-group/pydase_service_base.git
synced 2025-04-21 00:40:01 +02:00
fixing type hints
This commit is contained in:
parent
d14805ee7f
commit
f708b6d159
@ -3,6 +3,12 @@ from __future__ import annotations
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Any, NamedTuple
|
||||
|
||||
try:
|
||||
from typing import Self # type: ignore
|
||||
except ImportError:
|
||||
from typing_extensions import Self
|
||||
|
||||
|
||||
from confz import FileSource
|
||||
from influxdb_client import (
|
||||
Bucket,
|
||||
@ -77,7 +83,7 @@ class InfluxDBSession:
|
||||
self._write_api: WriteApi
|
||||
self._buckets_api: BucketsApi
|
||||
|
||||
def __enter__(self) -> InfluxDBSession:
|
||||
def __enter__(self) -> Self:
|
||||
self._client = InfluxDBClient(url=self.url, token=self.token, org=self.org)
|
||||
self._write_api = self._client.write_api(write_options=SYNCHRONOUS) # type: ignore
|
||||
return self
|
||||
|
@ -6,6 +6,11 @@ import logging
|
||||
import re
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
try:
|
||||
from typing import Self # type: ignore
|
||||
except ImportError:
|
||||
from typing_extensions import Self
|
||||
|
||||
from confz import FileSource
|
||||
from dateutil.parser import ParserError, parse # type: ignore
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
@ -155,7 +160,7 @@ class PostgresDatabaseSession(Session):
|
||||
)
|
||||
)
|
||||
|
||||
def __enter__(self) -> PostgresDatabaseSession:
|
||||
def __enter__(self) -> Self:
|
||||
"""Begins the runtime context related to the database session."""
|
||||
|
||||
super().__enter__()
|
||||
|
Loading…
x
Reference in New Issue
Block a user