feat: expose DataFrame.write_table by timsaucer · Pull Request #1264 · apache/datafusion-python

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR exposes the DataFrame.write_table functionality from DataFusion to Python, along with supporting dataframe writer options. It enables users to write DataFrame results directly to registered tables with configurable write operations and formatting options.

  • Adds Python wrappers for DataFrameWriteOptions and InsertOp enum
  • Introduces DataFrame.write_table method for writing to registered tables
  • Enhances existing write methods (write_csv, write_json, write_parquet) with optional write options

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib.rs Registers new Python classes for insert operations and write options
src/dataframe.rs Implements Rust bindings for write options and insert operations, updates write methods
python/datafusion/dataframe.py Adds Python wrapper classes and updates DataFrame write methods with new options
python/datafusion/init.py Exports new classes in public API
python/tests/test_dataframe.py Adds comprehensive test coverage for new functionality
Comments suppressed due to low confidence (1)

python/tests/test_dataframe.py:1

  • The parameter name write_options is inconsistent with the Rust function signature which expects a positional parameter, not a keyword argument.
# Licensed to the Apache Software Foundation (ASF) under one

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.