Skip to content

Commit bebaea2

Browse files
committed
added parquet export example for deprecated sift_py
1 parent 04e4530 commit bebaea2

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

python/CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,32 @@ Format-by-format support:
3636
- **TDMS**: new in this release. Auto-detected from `.tdms`. Detection is also fully client-side and maps TDMS groups and channels onto Sift channels.
3737

3838
#### Parquet as an Export Output Format
39-
`client.data_export.export(...)` now accepts `ExportOutputFormat.PARQUET` alongside the existing CSV and Sun/WinPlot options. Unlike the `sift_py` `DataService` + `DataFrame.to_parquet()` pattern (which buffers everything in memory), this runs as a server-side job and scales to large exports.
39+
`client.data_export.export(...)` now accepts `ExportOutputFormat.PARQUET` alongside the existing CSV and Sun/WinPlot options. Unlike the `sift_py` `DataService` + `DataFrame.to_parquet()` pattern (async-only, buffers everything in memory, name-strings only), the new export API runs as a server-side job, works sync or async, accepts `Asset`/`Channel` objects or IDs, and scales to large exports.
4040

4141
```python
42+
# sift_py (deprecated): no dedicated export API, so query in-memory and write yourself
43+
import pandas as pd
44+
from sift_py.data.query import ChannelQuery, DataQuery
45+
from sift_py.data.service import DataService
46+
from sift_py.grpc.transport import use_sift_async_channel
47+
48+
async with use_sift_async_channel({"uri": sift_uri, "apikey": apikey}) as channel:
49+
result = await DataService(channel).execute(DataQuery(
50+
asset_name="my_asset",
51+
start_time=start,
52+
end_time=stop,
53+
channels=[ChannelQuery(channel_name="my_channel")],
54+
))
55+
pd.DataFrame(result.all_channels()[0].columns()).to_parquet("out.parquet")
56+
57+
# sift_client
4258
from sift_client import SiftClient
4359
from sift_client.sift_types.export import ExportOutputFormat
4460

4561
client = SiftClient(api_key=apikey, grpc_url=grpc_url, rest_url=rest_url)
4662
job = client.data_export.export(
47-
runs=["run-id"],
63+
assets=["my_asset"], # accepts Asset objects or IDs
64+
channels=["my_channel"], # accepts Channel objects or IDs
4865
start_time=start,
4966
stop_time=stop,
5067
output_format=ExportOutputFormat.PARQUET,

0 commit comments

Comments
 (0)