28 lines
573 B
Python
28 lines
573 B
Python
from __future__ import annotations
|
|
|
|
|
|
def build_workspace_log_metadata(
|
|
*,
|
|
section: str,
|
|
workspace_id,
|
|
target_id,
|
|
target_label: str,
|
|
extra: dict | None = None,
|
|
) -> dict:
|
|
metadata = {
|
|
"workspace_id": str(workspace_id),
|
|
"section": section,
|
|
"target_id": str(target_id),
|
|
"target_label": target_label,
|
|
}
|
|
if extra:
|
|
metadata.update(
|
|
{
|
|
key: value
|
|
for key, value in extra.items()
|
|
if value is not None
|
|
}
|
|
)
|
|
return metadata
|
|
|