rm FormatSettings from tryConvertFieldToType for backport

This commit is contained in:
Michael Stetsyuk 2024-09-20 11:25:07 +01:00
parent aa953a7136
commit 78d140e4c9
2 changed files with 3 additions and 3 deletions

View File

@ -572,12 +572,12 @@ Field convertFieldToTypeImpl(const Field & src, const IDataType & type, const ID
}
Field tryConvertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint, const FormatSettings & format_settings)
Field tryConvertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint)
{
/// TODO: implement proper tryConvertFieldToType without try/catch by adding template flag to convertFieldToTypeImpl to not throw an exception.
try
{
return convertFieldToType(from_value, to_type, from_type_hint, format_settings);
return convertFieldToType(from_value, to_type, from_type_hint);
} catch (...)
{
return {};

View File

@ -18,7 +18,7 @@ class IDataType;
Field convertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint = nullptr);
/// Same as convertFieldToType but returns empty Field in case of an exception.
Field tryConvertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint = nullptr, const FormatSettings & format_settings = {});
Field tryConvertFieldToType(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint = nullptr);
/// Does the same, but throws ARGUMENT_OUT_OF_BOUND if value does not fall into the range.
Field convertFieldToTypeOrThrow(const Field & from_value, const IDataType & to_type, const IDataType * from_type_hint = nullptr);