Verbindung zu Daten

Einführung in Data Quality mit Great Expectations

Davina Moossazadeh

Data Scientist

Komponenten

GX-Komponenten – Python-Klassen, die Daten- und Validierungsobjekte repräsentieren

  • Data Context ✅
  • Data Sources & Data Assets (✔)
  • Batch Definitions & Batches ☐
  • Expectations ☐
  • Expectation Suites ☐
  • Validation Definitions ☐
  • Checkpoints & Actions ☐
  • Data Docs ☐
1 https://docs.greatexpectations.io/docs/core/introduction/gx_overview
Einführung in Data Quality mit Great Expectations

Datenquellen

Data Source – Ein Objekt, das GX sagt, wie es sich mit einer bestimmten externen Datenquelle verbindet

SQL-Logo.

Spark-Logo.

Pandas-Logo.

1 https://docs.greatexpectations.io/docs/core/connect_to_data/dataframes/
Einführung in Data Quality mit Great Expectations

Datenquellen

Data Source – Ein Objekt, das GX sagt, wie es sich mit einer bestimmten externen Datenquelle verbindet

SQL-Logo.

Spark-Logo.

Pandas-Logo – durch einen Rahmen hervorgehoben.

1 https://docs.greatexpectations.io/docs/core/connect_to_data/dataframes/
Einführung in Data Quality mit Great Expectations

Eine Datenquelle erstellen

Datenquellen mit dem Attribut .data_sources verwalten, mittels .add_pandas():

data_source = context.data_sources.add_pandas(

name="my_pandas_datasource" )

Hinweis: Der Parameter name in GX ist anders als der Python-Variablenname

  • Du kannst unterschiedliche Werte setzen, z. B. "my_pandas_datasource" vs. data_source
1 https://docs.greatexpectations.io/docs/core/connect_to_data/dataframes/
Einführung in Data Quality mit Great Expectations

Data Assets

Data Asset – Eine Sammlung von Datensätzen innerhalb einer Datenquelle

data_asset = data_source.add_dataframe_asset(

name="my_dataframe_asset" )
1 https://docs.greatexpectations.io/docs/core/connect_to_data/dataframes/
Einführung in Data Quality mit Great Expectations

Cheat Sheet

Datenquelle aus Data Context erstellen:

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

Data Asset aus Datenquelle erstellen:

data_asset = data_source.add_dataframe_asset(
    name: str
)
Einführung in Data Quality mit Great Expectations

Lass uns üben!

Einführung in Data Quality mit Great Expectations

Preparing Video For Download...