Skip to content

Commit

Permalink
MSVC compat
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Aug 18, 2024
1 parent 95a8996 commit 31399e0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pantab/writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ struct NumericCreatorInserter<Precision, Scale> {
static void insert(funcMapType &func_map) {
func_map.emplace(std::make_pair(Precision, Scale),
[](hyperapi::Inserter &inserter, std::string_view sv) {
// TODO: separate Precision and Scale
hyperapi::Numeric<Precision, Scale> value{sv};
hyperapi::string_view hsv{sv}; // for MSVC
hyperapi::Numeric<Precision, Scale> value(hsv);
inserter.add(value);
});
}
Expand Down
8 changes: 8 additions & 0 deletions tests/test_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def test_decimal_roundtrip(tmp_hyper, compat):
("no_fractional", pa.decimal128(38, 0)),
("mixed_decimal", pa.decimal128(38, 10)),
("only_fractional", pa.decimal128(38, 38)),
("five_two", pa.decimal128(5, 2)),
]
)

Expand All @@ -35,6 +36,13 @@ def test_decimal_roundtrip(tmp_hyper, compat):
None,
]
),
pa.array(
[
"123.45",
"-543.21",
None,
]
),
],
schema=schema,
)
Expand Down

0 comments on commit 31399e0

Please sign in to comment.