JackieTien97 opened a new pull request, #17035: URL: https://github.com/apache/iotdb/pull/17035
This pull request introduces a new streaming DataFrame interface to the IoTDB Python client, enabling users to efficiently fetch large query results in manageable chunks. The main changes add support for iterating over result sets by DataFrame, buffering data internally, and updating example scripts to demonstrate the new API. **Streaming DataFrame API:** * Added `has_next_df()` and `next_df()` methods to `SessionDataSet` to allow users to check for and retrieve the next chunk of results as a DataFrame. * Implemented internal buffering in `IoTDBRpcDataSet` with `__df_buffer`, and provided methods `_has_buffered_data()` and `next_dataframe()` to manage and return DataFrames of size `fetch_size`. [[1]](diffhunk://#diff-1388017f38621e1eb39eee517df57e5202875a02dc8174884263c64aa5899011R124-R129) [[2]](diffhunk://#diff-1388017f38621e1eb39eee517df57e5202875a02dc8174884263c64aa5899011R249-R309) * Refactored result set processing logic into `_process_buffer()` and `_build_dataframe()` to support both streaming and batch DataFrame construction. **Example and usability improvements:** * Updated `session_example.py` and `table_model_session_example.py` to demonstrate usage of the new streaming DataFrame API. [[1]](diffhunk://#diff-b1df91bd424fd737f689b9545fc925448a85ced4e997d250130851517b1271aaR414-R419) [[2]](diffhunk://#diff-c011342abb6a27b2fe7fe1cce58befa08bc4c19b93da479dfe7a22273f9f2c59R161-R164) * Added missing type import for `Optional` to support new method signatures. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
