Skip to content

Commit 7df51c0

Browse files
author
babenko
committed
Properly format object types
commit_hash:de54d92d32ae4139b5f630d25bfb265f343c9c1c
1 parent 4e55354 commit 7df51c0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

yt/yt/client/object_client/helpers.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,11 @@ bool IsSchemaType(EObjectType type)
330330
return (static_cast<ui32>(type) & SchemaObjectTypeMask) != 0;
331331
}
332332

333+
TString FormatObjectType(EObjectType type)
334+
{
335+
return IsSchemaType(type) ? Format("schema:%v", TypeFromSchemaType(type)) : FormatEnum(type);
336+
}
337+
333338
bool IsGlobalCellId(TCellId cellId)
334339
{
335340
auto type = TypeFromId(cellId);

yt/yt/client/object_client/helpers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ EObjectType SchemaTypeFromType(EObjectType type);
119119
//! Returns the regular type for a given schema #type.
120120
EObjectType TypeFromSchemaType(EObjectType type);
121121

122+
//! Formats object type into string (taking schemas into account).
123+
TString FormatObjectType(EObjectType type);
124+
122125
//! Constructs the id from its parts.
123126
TObjectId MakeId(
124127
EObjectType type,

0 commit comments

Comments
 (0)