Skip to content

write_metadata_records

Public callable

Write metadata records to a configured metadata sink.

Parameters:

Name Type Description Default
records Any

Value used by this callable.

required
table_identifier Any

Value used by this callable.

required
writer Any

Value used by this callable.

None
mode Any

Value used by this callable.

'append'

Returns:

Type Description
Any

Structured output produced by this callable.

Source code in src/fabricops_kit/metadata.py
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
def write_metadata_records(records: list[dict], table_identifier: str, writer=None, mode: str = "append", **options):
    """Write metadata records to a configured metadata sink.

        Parameters
        ----------
        records : Any
            Value used by this callable.
        table_identifier : Any
            Value used by this callable.
        writer : Any
            Value used by this callable.
        mode : Any
            Value used by this callable.

        Returns
        -------
        Any
            Structured output produced by this callable.
    """
    if not records:
        return None
    if writer is None:
        raise NotImplementedError(
            "No metadata writer provided. Inject a writer(records, table_identifier, mode='append', **options) adapter."
        )
    return writer(records, table_identifier, mode=mode, **options)