timsaucer opened a new pull request, #1569: URL: https://github.com/apache/datafusion-python/pull/1569
# Which issue does this PR close? Closes #. No dedicated tracking issue; related to umbrella issue #462 (interface design / user stories). # Rationale for this change DataFusion's `SessionContext` exposes `write_csv`, `write_json`, and `write_parquet` methods that take an already-built `Arc<dyn ExecutionPlan>` and a target path. These complement the existing per-`DataFrame` write methods and are the right entry point when a caller already holds a physical plan -- for example after running custom physical optimizer rules (recently exposed via PR #1557) or after constructing a plan directly. The Python bindings did not surface them. # What changes are included in this PR? - `crates/core/src/context.rs`: add `write_csv`, `write_json`, and `write_parquet` PyO3 methods on `PySessionContext`. Each accepts a `PyExecutionPlan` and a path, converts the plan to `Arc<dyn ExecutionPlan>`, and delegates to the matching upstream `SessionContext` method. `write_parquet` passes `None` for the `WriterProperties` argument; per-partition Parquet tuning remains on `DataFrame.write_parquet`. - `python/datafusion/context.py`: add Python wrappers with doctest examples that round-trip data through a temp directory. The docstrings flag `DataFrame.write_*` as the right entry point when callers need header control, compression, or other write options. # Are there any user-facing changes? Yes. Three new public methods on `datafusion.SessionContext`: - `write_csv(plan, path)` - `write_json(plan, path)` - `write_parquet(plan, path)` No breaking changes. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
