Skip to content

Commit

Permalink
change to
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe He committed Jun 3, 2024
1 parent e919a90 commit 76f613b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ibis/backends/pyspark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ def read_parquet(
if self.mode == "streaming":
raise NotImplementedError(
"Pyspark in streaming mode does not support direction registration of parquet files. "
"Please use `read_parquet_directory` instead."
"Please use `read_parquet_dir` instead."
)
path = util.normalize_filename(path)
spark_df = self._session.read.parquet(path, **kwargs)
Expand Down Expand Up @@ -742,7 +742,7 @@ def read_csv(
if self.mode == "streaming":
raise NotImplementedError(
"Pyspark in streaming mode does not support direction registration of CSV files. "
"Please use `read_csv_directory` instead."
"Please use `read_csv_dir` instead."
)
inferSchema = kwargs.pop("inferSchema", True)
header = kwargs.pop("header", True)
Expand Down Expand Up @@ -784,7 +784,7 @@ def read_json(
if self.mode == "streaming":
raise NotImplementedError(
"Pyspark in streaming mode does not support direction registration of JSON files. "
"Please use `read_json_directory` instead."
"Please use `read_json_dir` instead."
)
source_list = normalize_filenames(source_list)
spark_df = self._session.read.json(source_list, **kwargs)
Expand Down Expand Up @@ -929,7 +929,7 @@ def to_pyarrow_batches(
)

@util.experimental
def read_csv_directory(
def read_csv_dir(
self, path: str | Path, table_name: str | None = None, **kwargs: Any
) -> ir.Table:
"""Register a CSV directory as a table in the current database.
Expand Down Expand Up @@ -962,13 +962,13 @@ def read_csv_directory(
spark_df = self._session.readStream.csv(
path, inferSchema=inferSchema, header=header, **kwargs
)
table_name = table_name or util.gen_name("read_csv_directory")
table_name = table_name or util.gen_name("read_csv_dir")

spark_df.createOrReplaceTempView(table_name)
return self.table(table_name)

@util.experimental
def read_parquet_directory(
def read_parquet_dir(
self,
path: str | Path,
table_name: str | None = None,
Expand Down Expand Up @@ -998,13 +998,13 @@ def read_parquet_directory(
spark_df = self._session.read.parquet(path, **kwargs)
elif self.mode == "streaming":
spark_df = self._session.readStream.parquet(path, **kwargs)
table_name = table_name or util.gen_name("read_parquet_directory")
table_name = table_name or util.gen_name("read_parquet_dir")

spark_df.createOrReplaceTempView(table_name)
return self.table(table_name)

@util.experimental
def read_json_directory(
def read_json_dir(
self, path: str | Path, table_name: str | None = None, **kwargs: Any
) -> ir.Table:
"""Register a JSON file as a table in the current database.
Expand All @@ -1031,7 +1031,7 @@ def read_json_directory(
spark_df = self._session.read.json(path, **kwargs)
elif self.mode == "streaming":
spark_df = self._session.readStream.json(path, **kwargs)
table_name = table_name or util.gen_name("read_json_directory")
table_name = table_name or util.gen_name("read_json_dir")

spark_df.createOrReplaceTempView(table_name)
return self.table(table_name)
Expand Down Expand Up @@ -1060,7 +1060,7 @@ def _to_filesystem_output(
return sq

@util.experimental
def to_parquet_directory(
def to_parquet_dir(
self,
expr: ir.Expr,
path: str | Path,
Expand All @@ -1086,7 +1086,7 @@ def to_parquet_directory(
return self._to_filesystem_output(expr, "parquet", path, options)

@util.experimental
def to_csv_directory(
def to_csv_dir(
self,
expr: ir.Expr,
path: str | Path,
Expand Down

0 comments on commit 76f613b

Please sign in to comment.