whylogs.api.writer.writer
#
Module Contents#
Classes#
A Writable is an object that contains data to write to a file or files. |
|
Helper class that provides a standard way to create an ABC using |
|
Elide the Writable argument |
|
- class whylogs.api.writer.writer.Writable#
Bases:
abc.ABC
A Writable is an object that contains data to write to a file or files. These might be temporary files intended to be passed on to another consumer (e.g., WhyLabs servers) via a Writer.
- abstract write(path: Optional[str] = None, filename: Optional[str] = None, **kwargs: Any) Tuple[bool, Union[str, List[str]]] #
Writes the Writable’s data to file(s) under path (excluding filename(s)) if specified, else under _get_default_path(). filename specifies the file to write there. Writables can generate a default filename if None is specified. Returns a bool that’s True iff all files were written successfully and a list of the filenames (including path) written.
- writer(name: str = 'local', **kwargs: Any) WriterWrapper #
Utility method to create a Writer of the specified type
- Parameters
name (str) –
kwargs (Any) –
- Return type
- 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.
- 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
- class whylogs.api.writer.writer.WriterWrapper(writable: Writable, writer: Writer)#
Elide the Writable argument
- option(**kwargs: Any) WriterWrapper #
- Parameters
kwargs (Any) –
- Return type
- class whylogs.api.writer.writer.Writers#
- static get(name: str, writable: Optional[Writable] = None, **kwargs) Union[Writer, WriterWrapper] #
- Parameters
- Return type
Union[Writer, WriterWrapper]