summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/error/error_attributes.cpp
diff options
context:
space:
mode:
authorarkady-e1ppa <[email protected]>2024-11-29 22:02:21 +0300
committerarkady-e1ppa <[email protected]>2024-11-29 22:12:26 +0300
commitb21317884da9622ac16bbad26627ae014d72d6a7 (patch)
tree1af2253192c15fba295fdde1d23d6c7fc6792401 /library/cpp/yt/error/error_attributes.cpp
parent0924e1c53b7aec2c5efefe89499154b0a7e902f7 (diff)
YT-21233: Introduce ToAttributeValue cpo which removes dependency of TErrorAttribute from yt/core
Plan: 1) Remove `IAttributedDictionary` type from the public API. \+ 2) Remove `Set` method from public API in favor of `operator<<=`. \+ 3) Adopt `ConvertTo<T>` (or other name) CPO with proper extension into `NYT::NYson::ConvertTo` from `yt/core`. 4) Use CPO from (3) to eliminate direct dependency on `yt/core` of `Get/Find` methods from attributes API. 5) Adopt `ConvertToYsonString` (or other name) CPO with proper extension into `yt/core` customisations. 6) Use CPO from (5) to eliminate direct dependency on `yt/core` of `TErrorAttribute` ctor. 7) Swap attributes implementation to the one which doesn’t use `IAttributeDictionary`. 8) At this point `stripped_error*` can be moved to library/cpp/yt and so can recursively dependant on THROW macro methods `Get/Find/…`. 9) Adjust CPO’s to work with `std::string` instead of `TYsonString` assuming text format to be used (maybe `TString` for now). 10) Remove dep of `library/cpp/yt/error` on `yson` entirely. This pr addresses 5-6 steps of plan. Below is a brief explanation of design decisions. We also expressed everything related to key-value code in terms of aliases of `TErrorAttribute` so that later we could make a relatively simple switch to `std::string`. We expect to do steps 7-8 in the next pull request as everything should be ready commit_hash:de9feca2bd24d823b33d904ef0fa5f4856f9b020
Diffstat (limited to 'library/cpp/yt/error/error_attributes.cpp')
-rw-r--r--library/cpp/yt/error/error_attributes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/cpp/yt/error/error_attributes.cpp b/library/cpp/yt/error/error_attributes.cpp
index 2c1b5423146..09aa48eebb9 100644
--- a/library/cpp/yt/error/error_attributes.cpp
+++ b/library/cpp/yt/error/error_attributes.cpp
@@ -15,7 +15,7 @@ void TErrorAttributes::Clear()
}
}
-NYson::TYsonString TErrorAttributes::GetYsonAndRemove(const TString& key)
+TErrorAttributes::TValue TErrorAttributes::GetYsonAndRemove(const TKey& key)
{
auto result = GetYson(key);
Remove(key);