We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c32cf09 commit f9cc61aCopy full SHA for f9cc61a
src/opengeodeweb_microservice/database/data.py
@@ -1,9 +1,8 @@
1
-from sqlalchemy import String, JSON
+from sqlalchemy import String, JSON, select
2
from sqlalchemy.orm import Mapped, mapped_column
3
from .connection import get_session
4
from .base import Base
5
import uuid
6
-from typing import cast
7
8
9
class Data(Base):
@@ -47,4 +46,5 @@ def create(
47
46
@staticmethod
48
def get(data_id: str) -> "Data | None":
49
session = get_session()
50
- return cast("Data | None", session.get(Data, data_id))
+ data_query = select(Data).where(Data.id == data_id)
+ return session.scalars(data_query).first()
0 commit comments