Skip to content

Commit

Permalink
not serialize aggregator on dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
schaumb committed Nov 28, 2024
1 parent f14abbc commit 1a4dd74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/dataframe/old/datatable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ void SeriesIndex::setAggr(const std::string &aggr)
aggregator = Refl::get_enum<dataframe::aggregator_type>(aggr);
}

std::string SeriesIndex::toJSON() const
{
std::string res;
Conv::JSONObj obj{res};
obj("name", name);
if (aggregator) obj("aggregator", Conv::toString(*aggregator));
return res;
}

DataCube::iterator_t DataCube::begin() const
{
iterator_t res{this,
Expand Down
6 changes: 1 addition & 5 deletions src/dataframe/old/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ class SeriesIndex

[[nodiscard]] bool isDimension() const { return !aggregator; }

[[nodiscard]] consteval static auto members()
{
return std::tuple{&SeriesIndex::name,
&SeriesIndex::aggregator};
}
[[nodiscard]] std::string toJSON() const;
};

using SeriesList = Type::UniqueList<SeriesIndex>;
Expand Down

0 comments on commit 1a4dd74

Please sign in to comment.