Skip to content

Commit fd1967a

Browse files
committed
final mypy
rename List, Dict
1 parent 76762fd commit fd1967a

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

src/opengeodeweb_back/data.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import List, Optional
21
from sqlalchemy import String, JSON
32
from sqlalchemy.orm import Mapped, mapped_column
43
from .database import database, Base
@@ -13,17 +12,18 @@ class Data(Base):
1312
name: Mapped[str] = mapped_column(String, nullable=False)
1413
native_file_name: Mapped[str] = mapped_column(String, nullable=False)
1514
viewable_file_name: Mapped[str] = mapped_column(String, nullable=False)
16-
light_viewable: Mapped[Optional[str]] = mapped_column(String, nullable=True)
1715
geode_object: Mapped[str] = mapped_column(String, nullable=False)
18-
input_file: Mapped[Optional[dict]] = mapped_column(JSON, nullable=True)
19-
additional_files: Mapped[Optional[List[str]]] = mapped_column(JSON, nullable=True)
16+
17+
light_viewable: Mapped[str | None] = mapped_column(String, nullable=True)
18+
input_file: Mapped[str | None] = mapped_column(String, nullable=True)
19+
additional_files: Mapped[list[str] | None] = mapped_column(JSON, nullable=True)
2020

2121
@staticmethod
2222
def create(
2323
name: str,
2424
geode_object: str,
25-
input_file: Optional[dict] = None,
26-
additional_files: Optional[List[str]] = None
25+
input_file: str,
26+
additional_files: list[str] | None = None
2727
) -> "Data":
2828
input_file = input_file if input_file is not None else {}
2929
additional_files = additional_files if additional_files is not None else []

src/opengeodeweb_back/utils_functions.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import threading
44
import time
55
import zipfile
6-
from typing import List, Dict, Any
6+
from typing import Any
77

88
# Third party imports
99
import flask
@@ -157,9 +157,9 @@ def create_data_folder_from_id(data_id: str) -> str:
157157
def save_all_viewables_and_return_info(
158158
geode_object: str,
159159
data: Any,
160-
input_file: List[str],
161-
additional_files: List[str] = [],
162-
) -> Dict[str, Any]:
160+
input_file: list[str],
161+
additional_files: list[str] = [],
162+
) -> dict[str, Any]:
163163
data_entry = Data.create(
164164
name=data.name(),
165165
geode_object=geode_object,
@@ -202,13 +202,13 @@ def save_all_viewables_and_return_info(
202202

203203
def generate_native_viewable_and_light_viewable_from_object(
204204
geode_object: str, data: Any
205-
) -> Dict[str, Any]:
205+
) -> dict[str, Any]:
206206
return save_all_viewables_and_return_info(geode_object, data, input_file=[])
207207

208208

209209
def generate_native_viewable_and_light_viewable_from_file(
210210
geode_object: str, input_filename: str
211-
) -> Dict[str, Any]:
211+
) -> dict[str, Any]:
212212
temp_data_entry = Data.create(
213213
name="temp",
214214
geode_object=geode_object,
@@ -224,7 +224,7 @@ def generate_native_viewable_and_light_viewable_from_file(
224224
)
225225
shutil.copy2(full_input_filename, copied_full_path)
226226

227-
additional_files_copied: List[str] = []
227+
additional_files_copied: list[str] = []
228228
additional = geode_functions.additional_files(geode_object, full_input_filename)
229229
for additional_file in additional.mandatory_files + additional.optional_files:
230230
if additional_file.is_missing:

0 commit comments

Comments
 (0)