Learn how to work with views in PandasAI
PandasAI 3.0 is currently in beta. This documentation reflects the latest features and functionality, which may evolve before the final release.
Views are a feature of SQL databases that allow you to define logical subsets of data that can be used in queries. In PandasAI, you can define views in your semantic layer schema to organize and structure your data. Views are particularly useful when you want to:
You can create views either through YAML configuration or programmatically using Python.
Mutual Exclusivity:
table
and view
simultaneously.view
is true
, then the schema represents a view.Column Format:
[table].[column]
.from
and to
fields in relations
must follow the [table].[column]
format.loans.payment_amount
, heart.condition
.Relationships for Views:
columns
must have at least one relationship defined in relations
.from
and to
attributes in the [table].[column]
format.Dataset Requirements:
from
and to
) must be compatible types.