Skip to content

Cannot create a SessionContext with only a SessionConfig #826

Description

@jcrist

In datafusion 40.1.0 a bug was added where a SessionContext cannot be created when specifying only a SessionConfig. This is due to a small copy-paste error in the SessionContext.__init__.

In [1]: importdatafusionIn [2]: config=datafusion.SessionConfig()
In [3]: ctx=datafusion.SessionContext(config)
---------------------------------------------------------------------------AttributeErrorTraceback (mostrecentcalllast)
CellIn[3], line1---->1ctx=datafusion.SessionContext(config)
File~/miniforge3/envs/ibis/lib/python3.11/site-packages/datafusion/context.py:448, inSessionContext.__init__(self, config, runtime)
427"""Main interface for executing queries with DataFusion. 428  429 Maintains the state of the connection between a user and an instance (...) 445 df = ctx.read_csv("data.csv") 446 """447config=config.config_internalifconfigisnotNoneelseNone-->448runtime=runtime.config_internalifconfigisnotNoneelseNone450self.ctx=SessionContextInternal(config, runtime)
AttributeError: 'NoneType'objecthasnoattribute'config_internal'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions