Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-PLACET committed Dec 18, 2024
1 parent 8e2c6e4 commit 64f3177
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 41 deletions.
13 changes: 0 additions & 13 deletions include/sparrow/layout/list_layout/list_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,3 @@ namespace sparrow
return arrow_proxy{std::move(arr), std::move(schema)};
}
}

// #if defined(__cpp_lib_format)

// template <typename U>
// struct std::formatter<sparrow::list_array, U> : std::formatter<sparrow::array, U>
// {
// auto format(const sparrow::list_array& arr, U& ctx) -> decltype(ctx.out())
// {
// return std::formatter<sparrow::array, U>::format(arr, ctx);
// }
// };

// #endif
42 changes: 14 additions & 28 deletions include/sparrow/utils/format.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ namespace sparrow
std::format_to(out, "{}", std::string(count, separator[0]));
}

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
#endif
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
template <std::ranges::input_range Headers, RangeOfRanges Columns, typename OutputIt>
requires(std::convertible_to<std::ranges::range_value_t<Headers>, std::string>)
constexpr void to_table_with_columns(OutputIt out, const Headers& headers, const Columns& columns)
Expand All @@ -150,21 +158,7 @@ namespace sparrow
// max with names
for (size_t i = 0; i < std::ranges::size(headers); ++i)
{
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
#endif
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
widths[i] = std::max(widths[i], std::ranges::size(headers[i]));
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
}
to_row(out, widths, headers);
std::format_to(out, "{}", '\n');
Expand All @@ -178,21 +172,7 @@ namespace sparrow
columns,
[i](const auto& column)
{
#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wsign-conversion"
#endif
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wsign-conversion"
#endif
return column[i];
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
}
);
to_row(out, widths, row_range);
Expand All @@ -201,4 +181,10 @@ namespace sparrow

horizontal_separator(out, widths);
}
#if defined(__GNUC__)
# pragma GCC diagnostic pop
#endif
#if defined(__clang__)
# pragma clang diagnostic pop
#endif
}

0 comments on commit 64f3177

Please sign in to comment.