Hi, I am trying to run a simple validation using Microsoft Fabric.
import great_expectations as gx
import great_expectations.expectations as gxe
import great_expectations.exceptions as exceptions
from great_expectations.core.expectation_suite import ExpectationSuite
DATA_SOURCE_NAME_FABRIC: str = "Fabric Data Source"
SEMANTIC_MODEL_NAME: str = "Retail Analysis Sample PBIX"
ASSET_TABLE_NAME: str = "District"
BATCH_DEFINITION_NAME_FABRIC: str = "District Data Batch Definition"
context = gx.get_context(mode="file")
data_source = context.data_sources.add_fabric_powerbi(name=DATA_SOURCE_NAME_FABRIC,dataset=SEMANTIC_MODEL_NAME)
try:
table_asset = data_source.add_powerbi_table_asset(name=ASSET_TABLE_NAME,table=ASSET_TABLE_NAME)
except ValueError:
table_asset = data_source.get_asset(ASSET_TABLE_NAME)
batch_definition = table_asset.add_batch_definition(name=BATCH_DEFINITION_NAME_FABRIC)
batch_definition.get_batch().head()
# I got an error whenever I call the get_batch() method.
Error:
I tried using the data source pandas, but first converting using sempy then provide as batch_parameters, and it worked.
My environment:
Spark: 3.4
Great Expectations version 1.0.1