Skip to content

Commit

Permalink
fix defaults
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Kinard <[email protected]>
  • Loading branch information
Polber committed Dec 4, 2024
1 parent a024647 commit 629390a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sdks/python/apache_beam/yaml/yaml_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ def read_from_text(
or specified delimiter.
Args:
delimiter (str): Delimiter to split records.
path (str): The file path to read from as a local file path or a
delimiter (str): Delimiter to split records.
path (str): The file path to read from as a local file path or a
GCS ``gs://`` path. The path can contain glob
characters such as ``*`` and ``?``.
characters such as ``*`` and ``?``.
"""
return beam_io.ReadFromText(
file_pattern=path,
Expand Down Expand Up @@ -146,7 +146,7 @@ def read_from_csv(
GCS ``gs://`` path. The path can contain glob
characters such as ``*`` and ``?``.
"""
return ReadFromCsv(path=path, comment=comment, sep=delimiter, **kwargs)
return ReadFromCsv(path=path, comment=comment, delimiter=delimiter, **kwargs)


def write_to_csv(path: str, delimiter: Optional[str] = ",", **kwargs):
Expand Down Expand Up @@ -192,7 +192,7 @@ def write_to_json(path: str, **kwargs):
return WriteToJson(path=path, **kwargs)


def read_from_parquet(path: str, **kwargs):
def read_from_parquet(path: str, as_rows: bool = True, **kwargs):
"""Read a set of Parquet files defined by a given file pattern.
For more information about possible arguments, see
Expand All @@ -202,7 +202,7 @@ def read_from_parquet(path: str, **kwargs):
path (str): The file path to read from as a local file path or a
GCS ``gs://`` path.
"""
return ReadFromParquet(file_pattern=path, as_rows=True, **kwargs)
return ReadFromParquet(file_pattern=path, as_rows=as_rows, **kwargs)


def write_to_parquet(path: str, **kwargs):
Expand All @@ -220,7 +220,7 @@ def write_to_parquet(path: str, **kwargs):
return WriteToParquet(file_path_prefix=path, **kwargs)


def read_from_avro(path: str, **kwargs):
def read_from_avro(path: str, as_rows: bool = True, **kwargs):
"""Reads records from avro files into Beam rows.
Records that are of simple types will be
Expand All @@ -236,7 +236,7 @@ def read_from_avro(path: str, **kwargs):
path (str): The file path to read from as a local file path or a
GCS ``gs://`` path.
"""
return ReadFromAvro(file_pattern=path, as_rows=True, **kwargs)
return ReadFromAvro(file_pattern=path, as_rows=as_rows, **kwargs)


def write_to_avro(path: str, **kwargs):
Expand Down

0 comments on commit 629390a

Please sign in to comment.