whylogs.api.writer.writer#

Module Contents#

Classes#

Writer

Helper class that provides a standard way to create an ABC using

WriterWrapper

Elide the Writable argument

Writers

Attributes#

whylogs.api.writer.writer.Writable#
class whylogs.api.writer.writer.Writer#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

check_interval(interval_seconds: int) None#

Validate an interval configuration for a given writer.

Some writers only accepts certain interval configuration. Raise BadConfigError for an unacceptable interval.

Parameters

interval_seconds (int) –

Return type

None

abstract write(file: _Writable, dest: Optional[str] = None, **kwargs: Any) Tuple[bool, Union[str, List[Tuple[bool, str]]]]#

Calls Writable::write() to serialize the Wriable file to temporary file(s), then “sends” the temporary file(s) to dest according to the type of Writer. If dest is None, it uses the Writer’s default destination.

kwargs:

zip: bool Create a ZipFile containing the Writable’s file(s) if the Writer supports it zip_name: str Name of the ZipFile, will be auto-generated if None

Parameters
  • file (_Writable) –

  • dest (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, Union[str, List[Tuple[bool, str]]]]

abstract option(**kwargs: Any) Writer#
Parameters

kwargs (Any) –

Return type

Writer

class whylogs.api.writer.writer.WriterWrapper(writable: _Writable, writer: Writer)#

Elide the Writable argument

Parameters
  • writable (_Writable) –

  • writer (Writer) –

check_interval(interval_seconds: int) None#
Parameters

interval_seconds (int) –

Return type

None

write(dest: Optional[str] = None, **kwargs: Any) Tuple[bool, Union[str, List[Tuple[bool, str]]]]#
Parameters
  • dest (Optional[str]) –

  • kwargs (Any) –

Return type

Tuple[bool, Union[str, List[Tuple[bool, str]]]]

option(**kwargs: Any) WriterWrapper#
Parameters

kwargs (Any) –

Return type

WriterWrapper

class whylogs.api.writer.writer.Writers#
static get(name: str, writable: Optional[_Writable] = None, **kwargs) Union[Writer, WriterWrapper]#
Parameters
  • name (str) –

  • writable (Optional[_Writable]) –

Return type

Union[Writer, WriterWrapper]