Skip to content

Commit

Permalink
Replace DCHECK with a thrown exception, remove out of date IWYU pragma
Browse files Browse the repository at this point in the history
  • Loading branch information
dagardner-nv committed May 8, 2024
1 parent 1afd799 commit e5d543e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions morpheus/_lib/src/stages/file_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@
#include <memory>
#include <optional>
#include <sstream>
#include <stdexcept> // for invalid_argument
#include <utility>
// IWYU thinks we need __alloc_traits<>::value_type for vector assignments
// IWYU pragma: no_include <ext/alloc_traits.h>

namespace morpheus {
// Component public implementations
Expand All @@ -57,9 +56,9 @@ FileSourceStage::FileSourceStage(std::string filename,
m_filter_null_columns(std::move(filter_null_columns)),
m_json_lines(json_lines)
{
if (m_filter_null)
if (m_filter_null && m_filter_null_columns.empty())
{
DCHECK(!m_filter_null_columns.empty()) << "Filter null columns must not be empty if filter_null is true";
throw std::invalid_argument("Filter null columns must not be empty if filter_null is true");
}
}

Expand Down

0 comments on commit e5d543e

Please sign in to comment.