SQL: Fix crash at reshape failed with try catch (dirty).

dev
Pierre-Antoine 2025-04-23 15:29:27 +02:00
parent 79ee1c3cfa
commit 9857615a12
1 changed files with 11 additions and 3 deletions

View File

@ -434,10 +434,18 @@ class ReadTableForOpen:
for dest, resh in SNR_vars: for dest, resh in SNR_vars:
SNR = np_f64_parse(next(it)) SNR = np_f64_parse(next(it))
if len(SNR) == 0: try:
dest.append(np.array([])) if len(SNR) != 0:
else:
dest.append(SNR.reshape(resh[i].shape)) dest.append(SNR.reshape(resh[i].shape))
else:
dest.append(np.array([]))
except:
logger.warning(
"SQL: read_table_BS_raw_data_SNR: "
+ "failed to reshape data from "
+ f"{SNR.shape} to {resh[i].shape}"
)
dest.append(np.array([]))
def read_table_BS_raw_data_rest(self, query, i): def read_table_BS_raw_data_rest(self, query, i):
np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64) np_f64_parse = lambda d: np.frombuffer(d, dtype=np.float64)