langchain.utilities.powerbi.PowerBIDataset¶

class langchain.utilities.powerbi.PowerBIDataset(*, dataset_id: str, table_names: List[str], group_id: Optional[str] = None, credential: Optional[TokenCredential] = None, token: Optional[str] = None, impersonated_user_name: Optional[str] = None, sample_rows_in_table_info: ConstrainedIntValue = 1, schemas: Dict[str, str] = None, aiosession: Optional[ClientSession] = None)[source]¶

Bases: BaseModel

Create PowerBI engine from dataset ID and credential or token.

Use either the credential or a supplied token to authenticate. If both are supplied the credential is used to generate a token. The impersonated_user_name is the UPN of a user to be impersonated. If the model is not RLS enabled, this will be ignored.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param aiosession: Optional[aiohttp.ClientSession] = None¶
param credential: Optional[TokenCredential] = None¶
param dataset_id: str [Required]¶
param group_id: Optional[str] = None¶
param impersonated_user_name: Optional[str] = None¶
param sample_rows_in_table_info: int = 1¶
Constraints
  • exclusiveMinimum = 0

  • maximum = 10

param schemas: Dict[str, str] [Optional]¶
param table_names: List[str] [Required]¶
param token: Optional[str] = None¶
async aget_table_info(table_names: Optional[Union[List[str], str]] = None) str[source]¶

Get information about specified tables.

async arun(command: str) Any[source]¶

Execute a DAX command and return the result asynchronously.

validator fix_table_names  »  table_names[source]¶

Fix the table names.

get_schemas() str[source]¶

Get the available schema’s.

get_table_info(table_names: Optional[Union[List[str], str]] = None) str[source]¶

Get information about specified tables.

get_table_names() Iterable[str][source]¶

Get names of tables available.

run(command: str) Any[source]¶

Execute a DAX command and return a json representing the results.

validator token_or_credential_present  »  all fields[source]¶

Validate that at least one of token and credentials is present.

property headers: Dict[str, str]¶

Get the token.

property request_url: str¶

Get the request url.

property table_info: str¶

Information about all tables in the database.

model Config[source]¶

Bases: object

Configuration for this pydantic object.

arbitrary_types_allowed = True¶

Examples using PowerBIDataset¶