Awesome06 opened a new pull request, #1806:
URL: https://github.com/apache/datafusion-python/pull/1806

   # Which issue does this PR close?
   
   Closes #1771.
   
   # Rationale for this change
   
   The `datafusion` package root re-exported around 30 classes plus common 
functions. Following the guideline established in DataFusion 55.0.0, the 
package root should hold what a typical program constructs or calls on the 
common path. Types that are only named (enums, options, plan types, and catalog 
protocols) belong in their respective submodules (`datafusion.dataframe`, 
`datafusion.plan`, `datafusion.catalog`, `datafusion.options`, 
`datafusion.expr`, `datafusion.user_defined`, etc.).
   
   # What changes are included in this PR?
   
   1. **Package root curation**:
      - Kept primary builders and entry points in `datafusion.__all__` 
(`SessionContext`, `SessionConfig`, `RuntimeEnvBuilder`, 
`SessionExtensionComponents`, `DataFrame`, `Expr`, `col`, `lit`, `read_*`, 
`udf`, `udaf`, `udtf`, `udwf`, `Accumulator`, and public submodules).
      - Deprecated root re-exports for 22 specialized types and classes:
        - `datafusion.dataframe`: `DataFrameWriteOptions`, `ExplainFormat`, 
`InsertOp`, `ParquetColumnOptions`, `ParquetWriterOptions`
        - `datafusion.plan`: `ExecutionPlan`, `LogicalPlan`, `Metric`, 
`MetricsSet`, `PhysicalPartitioning`
        - `datafusion.catalog`: `Catalog`, `Table`, `TableProviderFactory`, 
`TableProviderFactoryExportable`
        - `datafusion.common`: `DFSchema`
        - `datafusion.expr`: `WindowFrame`
        - `datafusion.context`: `SQLOptions`
        - `datafusion.options`: `CsvReadOptions`
        - `datafusion.record_batch`: `RecordBatch`, `RecordBatchStream`
        - `datafusion.user_defined`: `TableFunction`, `ScalarUDF`, 
`AggregateUDF`, `WindowUDF`
        - `datafusion.dataframe_formatter`: `configure_formatter`
      - Added module-level `__getattr__` deprecation shim raising 
`DeprecationWarning` (stacklevel=2) with migration guidance for each deprecated 
symbol.
   2. **Move `string_literal` & `str_lit`**:
      - Moved to `datafusion.expr` alongside `Expr.string_literal`, preserving 
deprecated root shims for backward compatibility.
   3. **Tests & tooling**:
      - Added comprehensive tests in `python/tests/test_imports.py` testing 
`__all__`, warning emission, and target module resolution.
      - Updated `python/tests/test_wrapper_coverage.py` to recognize moved 
exports.
      - Updated internal call sites, examples, and doctests.
   4. **Documentation**:
      - Updated `AGENTS.md` and `docs/source/contributor-guide/introduction.md`.
      - Added a full before/after migration table to 
`docs/source/user-guide/upgrade-guides.md` under DataFusion 56.0.0.
   
   # Are there any user-facing changes?
   
   Yes. Importing any of the deprecated symbols from `datafusion` now emits a 
`DeprecationWarning` indicating the canonical submodule to import from. All 
deprecated symbols continue to work throughout 56.0.0.
   


-- 
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]

Reply via email to