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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user