Skip to content

Commit 7cb01a6

Browse files
authored
feat: add hidden accessor for tag (#60)
1 parent 633ffc1 commit 7cb01a6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,8 @@ PYBIND11_MODULE(_core, m)
998998
[&](VW::cs_label* cs_label) { ex.l.cs = *cs_label; },
999999
},
10001000
label);
1001-
});
1001+
})
1002+
.def("_get_tag", [](VW::example& ex) -> std::string { return std::string(ex.tag.data(), ex.tag.size()); });
10021003

10031004
py::class_<workspace_with_logger_contexts>(m, "Workspace")
10041005
.def(py::init(

src/vowpal_wabbit_next/_core.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class DenseParameters():
9595
class Example():
9696
def __init__(self) -> None: ...
9797
def _get_label(self, arg0: LabelType) -> typing.Union[SimpleLabel, MulticlassLabel, CBLabel, CSLabel, None]: ...
98+
def _get_tag(self) -> str: ...
9899
def _is_newline(self) -> bool: ...
99100
def _set_label(self, arg0: typing.Union[SimpleLabel, MulticlassLabel, CBLabel, CSLabel, None]) -> None: ...
100101
pass

0 commit comments

Comments
 (0)