Perf: Polars-Import lazy gemacht (nur bei DB-Nutzung laden)

Polars wird nicht mehr beim App-Start importiert, sondern erst wenn
eine Datenbankabfrage tatsächlich ausgeführt wird. Beschleunigt den
Kaltstart der Anwendung.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 20:05:48 +01:00
parent 9be6ac24e9
commit 22bc693d4d
2 changed files with 6 additions and 6 deletions
+2 -1
View File
@@ -10,7 +10,6 @@ import time
import logging
from pathlib import Path
import polars as pl
from PySide6.QtCore import QThread, Signal, Qt
from PySide6.QtWidgets import QMessageBox, QProgressDialog
@@ -31,6 +30,7 @@ class DatabaseQueryThread(QThread):
self.connection_string = connection_string
def run(self):
import polars as pl
try:
df = pl.read_database_uri(self.sql_query, self.connection_string, engine="connectorx").sort(
["reporttyp_bez", "report_bez", "repfile_bez"]
@@ -208,6 +208,7 @@ class DatabaseMixin:
Returns:
list[TreeNode]: Liste der erstellten Root-Nodes
"""
import polars as pl
try:
start_time = time.time()