From 316b8e05b775df54e147f12539d17f38dc3bcf2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 6 May 2025 15:46:20 +0200 Subject: [PATCH 1/2] Check that the Series has been parsed --- src/Series.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Series.cpp b/src/Series.cpp index d7aa1d2501..4f798b73b1 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -1244,6 +1244,17 @@ std::future Series::flush_impl( internal::FlushParams const &flushParams, bool flushIOHandler) { + if (!written() && access::readOnly(IOHandler()->m_frontendAccess) && + IOHandler()->m_work.empty()) + { + throw error::WrongAPIUsage( + "Attempting to flush the Series in Read mode even though no " + "operation has been performed yet. If this error occurs to you in " + "Access::READ_LINEAR mode, then either try using " + "Series::parseBase() or use Series::snapshots() / " + "Series::readIterations() to access the first Iteration. If this " + "occurs in Access::READ_ONLY, then this is likely a bug."); + } IOHandler()->m_lastFlushSuccessful = true; try { From 8ad5d64584662956f5055bbdda0a88cbf4184ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 6 May 2025 15:46:46 +0200 Subject: [PATCH 2/2] Do not attempt to read all steps when parse preference is per step --- src/Series.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Series.cpp b/src/Series.cpp index 4f798b73b1..57f3563379 100644 --- a/src/Series.cpp +++ b/src/Series.cpp @@ -3525,7 +3525,10 @@ bool Series::randomAccessSteps() const } return false; }; - return iterationEncoding() == IterationEncoding::variableBased && + return get().m_parsePreference.value_or( + internal::ParsePreference::UpFront) == + internal::ParsePreference::UpFront && + iterationEncoding() == IterationEncoding::variableBased && randomAccess(IOHandler()->m_backendAccess); }