whylogs.api.writer.gcs
#
Module Contents#
Classes#
A whylogs writer to upload DatasetProfileViews onto Google Cloud Storage (GCS). |
Attributes#
- whylogs.api.writer.gcs.logger#
- class whylogs.api.writer.gcs.GCSWriter(gcs_client: Optional[google.cloud.storage.Client] = None, object_name: Optional[str] = None, bucket_name: Optional[str] = None)#
Bases:
whylogs.api.writer.Writer
A whylogs writer to upload DatasetProfileViews onto Google Cloud Storage (GCS).
>**IMPORTANT**: In order to correctly connect to your GCS container, make sure you have the following environment variables set: [GOOGLE_APPLICATION_CREDENTIALS]
- Parameters
- Returns
- Return type
Examples
An example usage of this method can be represented with the simple code above. Here we are assuming the user has already assigned a pandas.DataFrame to the df variable.
```python import whylogs as why
profile = why.log(pandas=df) profile.writer(“gcs”).option(bucket_name=”my_bucket”).write() ```
- write(file: whylogs.api.writer.writer._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
- option(**kwargs: Any) whylogs.api.writer.Writer #
bucket_name: str GCS bucket name to write to object_name: str GCS object name to create gcs_client: ? GCS client object
- Parameters
kwargs (Any) –
- Return type