Export: Great Expectations

Transforms a data contract into a comprehensive Great Expectations JSON suite. If the contract includes multiple models, specify the model with --schema-name.

{/* AUTOGENERATED EXAMPLE: do not edit by hand; regenerate with the update script. */}

datacontract export great-expectations orders.odcs.yaml --schema-name orders

Running this against the example orders contract produces:

{
  "name": "orders.1.0.0",
  "expectations": [
    {
      "type": "expect_table_columns_to_match_ordered_list",
      "kwargs": {
        "column_list": [
          "order_id",
          "order_timestamp",
          "customer_id",
          "order_total",
          "status"
        ]
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "order_id",
        "type_": "VARCHAR"
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_unique",
      "kwargs": {
        "column": "order_id"
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "order_timestamp",
        "type_": "TIMESTAMP"
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "customer_id",
        "type_": "VARCHAR"
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "order_total",
        "type_": "NUMBER"
      },
      "meta": {}
    },
    {
      "type": "expect_column_values_to_be_of_type",
      "kwargs": {
        "column": "status",
        "type_": "VARCHAR"
      },
      "meta": {}
    }
  ],
  "meta": {}
}

{/* END AUTOGENERATED EXAMPLE */}

The export builds expectations from the model definition (with a fixed mapping) and from the quality rules of each model (see the expectations gallery).

Additional options