armor migrate-from great-expectations command converts a Great Expectations project on disk into an ODCS YAML document. Pipe the output straight into armor contract apply to port your expectation suites into AnomalyArmor validity rules.
great_expectations.yml and the expectation-suite JSON files directly. You do not need the great_expectations pip package installed to run the migration.
What gets mapped
Native ODCS fields
These expectations land on the standard ODCS property surface so they round-trip through any ODCS tool, not just AnomalyArmor.| Great Expectations | ODCS field |
|---|---|
expect_column_values_to_not_be_null | schema[].properties[].required = true |
expect_column_values_to_be_unique | schema[].properties[].unique = true |
AnomalyArmor validity rules
These expectations map to validity rules undercustomProperties.anomalyarmor.validity.
| Great Expectations | AnomalyArmor rule_type | Notes |
|---|---|---|
expect_column_values_to_be_in_set | allowed_values | value_set → values |
expect_column_values_to_match_regex | regex_match | regex → pattern |
expect_column_values_to_be_between | range_bounds | min_value / max_value → min / max |
expect_column_value_lengths_to_be_between | length_bounds | min_value / max_value → min_length / max_length |
expect_column_values_to_match_strftime_format | format | %Y-%m-%d → iso_date; %Y-%m-%dT%H:%M:%S → iso_datetime |
Unmapped expectations
Anything not in the table above surfaces as a warning in the command summary rather than being silently dropped. The common ones that land in warnings today:expect_column_pair_*andexpect_multicolumn_*(cross-column logic)expect_column_kl_divergence_*and other statistical distribution checks- Custom expectations (
dbt_expectations.*, user-defined subclasses) expect_column_values_to_be_of_type(type-system translation is its own problem)- Table-scoped expectations like
expect_table_row_count_to_be_between(row-count monitoring needs its own follow-up wiring)
Project shapes supported
The adapter auto-detects whether you have a legacy (pre-v1) project or a v1 project using Fluent Datasources.-
Legacy projects. Expectation suites live as JSON under
{project_root}/expectations/*.json. The adapter walks that tree directly. -
v1 Fluent Datasources projects. The adapter reads the
fluent_datasourcesblock fromgreat_expectations.ymlto pull per-column type hints intoschema[].properties[].physicalType. Suites still need to live underexpectations/. If your project uses a non-default suite store (a database, S3, etc.), export the suites to disk before migrating:
Suite-to-table resolution
Great Expectations organizes suites by suite name, not by table. AnomalyArmor scopes every validity rule to atable_path. The adapter resolves the mapping in this order:
meta.anomalyarmor.table_pathinside the suite JSON (the explicit escape hatch).- The suite’s
expectation_suite_namefield (GE’s canonical source of truth for the suite’s logical name). - The suite filename without the
.jsonextension (final fallback).
Worked example
Given this legacy project layout:orders.json contains:
id seeded from the project path, so re-applying the same contract will dedupe rather than create duplicates.
Common Questions
How do I migrate from Great Expectations to AnomalyArmor?
Runarmor migrate-from great-expectations ./great_expectations/ to translate your expectation suites into ODCS YAML, then pipe it into armor contract apply --asset <uuid> -f -. The adapter is file-based and reads suite JSON directly, so you don’t need the great_expectations pip package installed on the migration host.
Which Great Expectations expectations are supported?
not_null and unique map to native ODCS required / unique. Six more map to AnomalyArmor validity rules: be_in_set, match_regex, be_between, value_lengths_between, and match_strftime_format. See the full mapping tables for exact field translations.
What happens to expectations the adapter can’t map?
They surface as warnings in the CLI summary, never silent drops. Common unsupported cases areexpect_column_pair_*, expect_multicolumn_*, KL-divergence / distribution checks, custom subclasses, and type checks. Re-author those as custom SQL checks after the migration rather than forcing them through the validity-rule shape.
Does the adapter work with Great Expectations v1 Fluent Datasources?
Yes. The adapter auto-detects v1 projects and reads thefluent_datasources block from great_expectations.yml to pull per-column type hints into physicalType. Suites still need to live on disk under expectations/, so if you use a non-default store (database, S3), export them to disk first. See Project shapes supported.
How does AnomalyArmor know which table an expectation suite belongs to?
The adapter resolves the suite-to-table mapping in this order:meta.anomalyarmor.table_path inside the suite JSON, then the suite’s expectation_suite_name field, then the filename. Use the meta.anomalyarmor.table_path escape hatch when suite names don’t match your target table paths. See Suite-to-table resolution.
Is it safe to re-run the migration?
Yes. The command produces a deterministic contractid seeded from the project path, so re-applying the same contract deduplicates instead of creating duplicates. Combine with armor contract plan first to preview the diff before apply.
