Skip to content

Commit 07e7afb

Browse files
committed
Fix path validate. (#311)
1 parent b9cb3f2 commit 07e7afb

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

butterfree/clients/spark_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def read(
5858
"""
5959
if not isinstance(format, str):
6060
raise ValueError("format needs to be a string with the desired read format")
61-
if not isinstance(path, (str, list)):
61+
if path and not isinstance(path, (str, list)):
6262
raise ValueError("path needs to be a string or a list of string")
6363

6464
df_reader: Union[
@@ -67,7 +67,7 @@ def read(
6767

6868
df_reader = df_reader.schema(schema) if schema else df_reader
6969

70-
return df_reader.format(format).load(path, **options) # type: ignore
70+
return df_reader.format(format).load(path=path, **options) # type: ignore
7171

7272
def read_table(self, table: str, database: str = None) -> DataFrame:
7373
"""Use the SparkSession.read interface to read a metastore table.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from setuptools import find_packages, setup
22

33
__package_name__ = "butterfree"
4-
__version__ = "1.2.0.dev9"
4+
__version__ = "1.2.0.dev10"
55
__repository_url__ = "https://github.com/quintoandar/butterfree"
66

77
with open("requirements.txt") as f:

tests/unit/butterfree/clients/test_spark_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_read(
6565

6666
# assert
6767
mocked_spark_read.format.assert_called_once_with(format)
68-
mocked_spark_read.load.assert_called_once_with(path, **options)
68+
mocked_spark_read.load.assert_called_once_with(path=path, **options)
6969
assert target_df.collect() == result_df.collect()
7070

7171
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)