Skip to content

Commit 7d869ba

Browse files
committed
python(feat): updated export.protos to support parquet
1 parent e3080e2 commit 7d869ba

4 files changed

Lines changed: 19 additions & 2 deletions

File tree

python/lib/sift_client/_tests/resources/test_exports.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
START = datetime(2025, 1, 1, tzinfo=timezone.utc)
3939
STOP = datetime(2025, 1, 2, tzinfo=timezone.utc)
4040
CSV = ExportOutputFormat.CSV
41+
PARQUET = ExportOutputFormat.PARQUET
4142

4243

4344
@pytest.fixture
@@ -240,6 +241,20 @@ def test_export_by_time_range(self, exports_api_sync, sift_client, nostromo_run)
240241
assert isinstance(job, Job)
241242

242243

244+
class TestParquetFormat:
245+
@pytest.mark.asyncio
246+
async def test_export_parquet_format(self, exports_api):
247+
"""Test that Parquet output format is accepted."""
248+
await exports_api.export(
249+
runs=["run-1"],
250+
start_time=START,
251+
stop_time=STOP,
252+
output_format=PARQUET,
253+
)
254+
call_kwargs = exports_api._low_level_client.export_data.call_args.kwargs
255+
assert call_kwargs["output_format"] == PARQUET
256+
257+
243258
class TestDictConversion:
244259
@pytest.mark.asyncio
245260
async def test_calculated_channel_dict_converted(self, exports_api):

python/lib/sift_client/resources/exports.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async def export(
7171
You cannot provide both ``runs`` and ``assets`` at the same time.
7272
7373
Args:
74-
output_format: The file format for the export (CSV or Sun/WinPlot).
74+
output_format: The file format for the export (CSV, Parquet, or Sun/WinPlot).
7575
runs: One or more Run objects or run IDs to export data from.
7676
assets: One or more Asset objects or asset IDs to export data from.
7777
start_time: Start of the time range to export. Required when using

python/lib/sift_client/resources/sync_stubs/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ class DataExportAPI:
593593
You cannot provide both ``runs`` and ``assets`` at the same time.
594594
595595
Args:
596-
output_format: The file format for the export (CSV or Sun/WinPlot).
596+
output_format: The file format for the export (CSV, Parquet, or Sun/WinPlot).
597597
runs: One or more Run objects or run IDs to export data from.
598598
assets: One or more Asset objects or asset IDs to export data from.
599599
start_time: Start of the time range to export. Required when using

python/lib/sift_client/sift_types/export.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class ExportOutputFormat(Enum):
1111
Attributes:
1212
CSV: Comma-separated values format.
1313
SUN: Sun (WinPlot) format (not used in certain environments).
14+
PARQUET: Apache Parquet columnar storage format.
1415
"""
1516

1617
CSV = ExportOutputFormatProto.EXPORT_OUTPUT_FORMAT_CSV
1718
SUN = ExportOutputFormatProto.EXPORT_OUTPUT_FORMAT_SUN
19+
PARQUET = ExportOutputFormatProto.EXPORT_OUTPUT_FORMAT_PARQUET

0 commit comments

Comments
 (0)