Emit a ``Mark`` event under the current or provided scope. Args: name: Event name to emit. handle: Optional scope handle that should own the event. When omitted, the current top-of-stack scope is used. data: Optional JSON payload attached to the event.
(
name: str,
*,
handle: ScopeHandle | None = None,
data: Json | None = None,
metadata: Json | None = None,
timestamp: datetime | None = None,
)
| 173 | |
| 174 | |
| 175 | def event( |
| 176 | name: str, |
| 177 | *, |
| 178 | handle: ScopeHandle | None = None, |
| 179 | data: Json | None = None, |
| 180 | metadata: Json | None = None, |
| 181 | timestamp: datetime | None = None, |
| 182 | ) -> None: |
| 183 | """Emit a ``Mark`` event under the current or provided scope. |
| 184 | |
| 185 | Args: |
| 186 | name: Event name to emit. |
| 187 | handle: Optional scope handle that should own the event. When omitted, |
| 188 | the current top-of-stack scope is used. |
| 189 | data: Optional JSON payload attached to the event. |
| 190 | metadata: Optional JSON metadata attached to the event. |
| 191 | timestamp: Optional timezone-aware ``datetime`` recorded on the mark |
| 192 | event. When omitted, the current runtime time is used. |
| 193 | |
| 194 | Returns: |
| 195 | None: This function returns after the event has been emitted. |
| 196 | |
| 197 | Notes: |
| 198 | A scope stack is created automatically when needed before the event is |
| 199 | emitted through the native runtime. ``timestamp`` must be a |
| 200 | timezone-aware ``datetime``; strings and naive datetimes are rejected. |
| 201 | """ |
| 202 | _ensure_scope_stack() |
| 203 | _native_event(name, handle=handle, data=data, metadata=metadata, timestamp=timestamp) |
| 204 | |
| 205 | |
| 206 | @contextmanager |
nothing calls this directly
no test coverage detected