Bileşenleri Yönetin

Great Expectations ile Veri Kalitesine Giriş

Davina Moossazadeh

Data Scientist

Bileşenler

GX bileşenleri - veriyi ve veri doğrulama varlıklarını temsil eden Python sınıfları

  • Data Context
  • Veri Kaynakları ve Veri Varlıkları
  • Batch Tanımları ve Batch'ler
  • Expectation'lar
  • Expectation Suite'leri
  • Doğrulama Tanımları
  • Checkpoint'ler ve Aksiyonlar
  • Data Docs
1 https://docs.greatexpectations.io/docs/core/introduction/gx_overview
Great Expectations ile Veri Kalitesine Giriş

GX'te bileşen yönetimi

Veri Kaynakları:

  • veriye bağlanır ve Veri Varlıklarını içerir

Expectation Suite'leri:

  • Expectation'ları barındırır

Doğrulama Tanımları:

  • Expectation'ları veriye karşı doğrular

Checkpoint'ler:

  • Doğrulamaları gruplayıp otomatikleştirir

context.data_sources

$$

context.suites

$$

context.validation_definitions

$$

context.checkpoints

Great Expectations ile Veri Kalitesine Giriş

Bileşen ekleme

Expectation Suite:

suite = context.suites.add(suite)

Doğrulama Tanımı:

validation_definition = context.validation_definitions.add(validation_definition)

Checkpoint:

checkpoint = context.checkpoints.add(
    checkpoint=checkpoint
)
Great Expectations ile Veri Kalitesine Giriş

Veri Kaynağı ekleme

data_source = context.data_sources.add_<TYPE_NAME>()

1 https://docs.greatexpectations.io/docs/core/connect_to_data/
Great Expectations ile Veri Kalitesine Giriş

pandas Veri Kaynağı Ekleme

pandas DataFrame'ler için Veri Kaynağını kolayca kurmak üzere .add_pandas() kullanın:

data_source = context.data_sources.add_pandas(
    name="my_pandas_datasource"
)
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri alma

Adını belirterek .get() ile bileşenleri alın:

context.<COMPONENT>s.get(

name: str )
data_source = context.data_sources.get(

name="my_pandas_datasource" )
print(data_source)
id: 46c91f1b-1db9-4351-b5dd-83e038c0f511
name: 'my_pandas_datasource'
type: pandas
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri alma

Veri Kaynakları:

context.data_sources.get(
    name="my_pandas_datasource"
)

Expectation Suite'leri:

context.suites.get(
    name="my_suite"
)

Doğrulama Tanımları:

context.validation_definitions.get(
    name="my_validation_definition"
)

Checkpoint'ler:

context.checkpoints.get(
    name="my_checkpoint"
)
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri listeleme

Ad ve üstverileriyle tüm bileşenleri listelemek için .all() kullanın:

context.<COMPONENT>s.all()
data_sources = context.data_sources.all()

print(data_sources)
{
    'my_pandas_datasource': PandasDatasource(
        type='pandas',
        name='my_pandas_datasource', 
        id=UUID('c22b16f7-6945-400e-932f-026cbd63b112'), 
        assets=[]
    )
}
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri listeleme

Veri Kaynakları:

context.data_sources.all()

Expectation Suite'leri:

context.suites.all()

Doğrulama Tanımları:

context.validation_definitions.all()

Checkpoint'ler:

context.checkpoints.all()
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri silme

Ad belirterek bileşenleri kaldırmak için .delete() kullanın:

context.<COMPONENT>s.delete(

name: str )
context.data_sources.delete(
    name="my_pandas_datasource"
)

print(context.data_sources.all())
{}
Great Expectations ile Veri Kalitesine Giriş

Bileşenleri silme

Veri Kaynakları:

context.data_sources.delete(
    name="my_pandas_datasource"
)

Expectation Suite'leri:

context.suites.delete(
    name="my_suite"
)

Doğrulama Tanımları:

context.validation_definitions.delete(
    name="my_validation_definition"
)

Checkpoint'ler:

context.checkpoints.delete(
    name="my_checkpoint"
)
Great Expectations ile Veri Kalitesine Giriş

Hızlı başvuru

Data Context'e bileşen ekleyin:

context.data_sources.add(data_source)

context.suites.add(suite)

context.validation_definitions.add(
    validation_definition
)

context.checkpoints.add(checkpoint)

Bileşen alma:

.get(name: str)

Bileşen listeleme:

.all()

Bileşen silme:

.delete(name: str)
Great Expectations ile Veri Kalitesine Giriş

Hadi pratik yapalım!

Great Expectations ile Veri Kalitesine Giriş

Preparing Video For Download...