Skip to content

Commit a93fb93

Browse files
committed
Add schema parameter to BaseDataset and ParquetDataset constructors
1 parent b96667a commit a93fb93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pydala/dataset.py

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(
2929
self,
3030
path: str,
3131
name: str | None = None,
32+
schema: pa.Schema | None = None,
3233
filesystem: AbstractFileSystem | None = None,
3334
bucket: str | None = None,
3435
partitioning: str | list[str] | None = None,
@@ -39,6 +40,7 @@ def __init__(
3940
**fs_kwargs,
4041
):
4142
self._path = path
43+
self._schema = schema
4244
self._bucket = bucket
4345
self._cached = cached
4446
self._format = format
@@ -173,6 +175,7 @@ def load(self):
173175
if self.has_files:
174176
self._arrow_dataset = pds.dataset(
175177
self._path,
178+
schema=self._schema,
176179
filesystem=self._filesystem,
177180
format=self._format,
178181
partitioning=self._partitioning,
@@ -858,6 +861,7 @@ def load(
858861

859862
self._arrow_dataset = pds.parquet_dataset(
860863
self._metadata_file,
864+
schema=self._schema,
861865
partitioning=self._partitioning,
862866
filesystem=self._filesystem,
863867
)

0 commit comments

Comments
 (0)