Dummy
Module for the DummyWriter class.
koheesio.spark.writers.dummy.DummyWriter #
A simple DummyWriter that performs the equivalent of a df.show() on the given DataFrame and returns the first row of data as a dict.
This Writer does not actually write anything to a source/destination, but is useful for debugging or testing purposes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n |
PositiveInt
|
Number of rows to show. |
20
|
truncate |
bool | PositiveInt
|
If set to |
True
|
vertical |
bool
|
If set to |
False
|
n
class-attribute
instance-attribute
#
truncate
class-attribute
instance-attribute
#
truncate: Union[bool, PositiveInt] = Field(
default=True,
description="If set to ``True``, truncate strings longer than 20 chars by default.If set to a number greater than one, truncates long strings to length ``truncate`` and align cells right.",
)
vertical
class-attribute
instance-attribute
#
vertical: bool = Field(
default=False,
description="If set to ``True``, print output rows vertically (one line per column value).",
)
Output #
DummyWriter output
execute #
execute() -> Output
Execute the DummyWriter
Source code in src/koheesio/spark/writers/dummy.py
int_truncate #
int_truncate(truncate_value) -> int
Truncate is either a bool or an int.
Parameters:
truncate_value : int | bool, optional, default=True If int, specifies the maximum length of the string. If bool and True, defaults to a maximum length of 20 characters.
Returns:
int The maximum length of the string.