Skip to content

Add missing SessionContext utility methods #1459

@timsaucer

Description

@timsaucer

Summary

Several utility and introspection methods on SessionContext from upstream DataFusion v53 are not yet exposed in datafusion-python.

Missing Methods

  • parse_sql_expr — parse a SQL expression string into a logical expression
  • execute_logical_plan — execute a logical plan and return a DataFrame
  • refresh_catalogs — refresh catalog metadata
  • session_start_time — get the session start time
  • enable_ident_normalization — configure whether identifiers are normalized (lowercased)
  • add_optimizer_rule — add a custom optimizer rule
  • remove_optimizer_rule — remove an optimizer rule by name
  • add_analyzer_rule — add a custom analyzer rule
  • table_provider — get a TableProvider by name

Upstream Reference

Implementation

  • Rust bindings: crates/core/src/context.rs
  • Python wrappers: python/datafusion/context.py

Notes

Some of these (optimizer/analyzer rules) may require exposing additional Rust types to Python, which could be complex. parse_sql_expr and execute_logical_plan are likely the most immediately useful.

Note: This gap analysis was performed using an AI agent comparing upstream DataFusion v53 documentation against the current datafusion-python codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions