map-conform 0.1.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- map_conform-0.3.0/.github/ISSUE_TEMPLATE/bug.yml +37 -0
- map_conform-0.3.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- map_conform-0.3.0/.github/ISSUE_TEMPLATE/feature.yml +16 -0
- map_conform-0.3.0/.github/pull_request_template.md +11 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.github/workflows/test.yml +7 -6
- map_conform-0.3.0/CHANGELOG.md +125 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/CLAUDE.md +6 -6
- map_conform-0.3.0/CONTRIBUTING.md +55 -0
- map_conform-0.3.0/PKG-INFO +203 -0
- map_conform-0.3.0/README.md +169 -0
- map_conform-0.3.0/SECURITY.md +42 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/_typos.toml +5 -0
- map_conform-0.3.0/conform.yml +9 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/creating-a-better-mapper-guidance.md +93 -84
- {map_conform-0.1.0 → map_conform-0.3.0}/docs/architecture-hld.md +83 -46
- map_conform-0.3.0/docs/cookbook.md +618 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/docs/detailed-design.md +162 -100
- {map_conform-0.1.0 → map_conform-0.3.0}/docs/exec-overview.md +30 -17
- {map_conform-0.1.0 → map_conform-0.3.0}/docs/plan-wbs.md +21 -9
- {map_conform-0.1.0 → map_conform-0.3.0}/docs/spec-reference.md +113 -7
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/README.md +21 -3
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/meltano.yml +7 -4
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/batch/columnar.py +17 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/batch/engine.py +43 -10
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/cli.py +52 -13
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/expr/functions.py +66 -18
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/map-conform-spec.schema.json +10 -7
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/mapper.py +3 -3
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/chain.py +27 -8
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/compile.py +77 -13
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/lower.py +20 -0
- map_conform-0.3.0/map_conform/plan/validate.py +171 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/vector.py +3 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/check.py +3 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/model.py +18 -8
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/reference.py +39 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/casts.py +112 -37
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/nested.py +11 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/numeric.py +65 -13
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/polars_vector.py +3 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/registry.py +0 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/temporal.py +35 -20
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/vector.py +58 -14
- {map_conform-0.1.0 → map_conform-0.3.0}/meltano.yml +5 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/pyproject.toml +1 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/batch/test_batch.py +44 -0
- map_conform-0.3.0/tests/bench/baseline.json +10 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/bench/test_bench.py +24 -10
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/bench/workload.py +3 -5
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/test_sdk_parity.py +6 -5
- map_conform-0.3.0/tests/e2e/lake_rows.py +28 -0
- map_conform-0.3.0/tests/e2e/test_target_ducklake.py +202 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/expr/test_functions.py +84 -3
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/boolean.csv +12 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/numeric.csv +17 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/parity/test_parity.py +104 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/parity/test_polars_parity.py +8 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/plan/test_chain.py +1 -3
- map_conform-0.3.0/tests/plan/test_column_flatten.py +115 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/plan/test_compile.py +27 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/test_check.py +82 -5
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/test_reference.py +13 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_cli.py +25 -0
- map_conform-0.3.0/tests/test_contract.py +103 -0
- map_conform-0.3.0/tests/test_cookbook.py +133 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_rejects_metrics.py +12 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_settings.py +1 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_undeclared.py +1 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_builtins.py +60 -1
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_numeric.py +10 -0
- map_conform-0.3.0/tests/transforms/test_vector_claims.py +74 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/uv.lock +4 -4
- map_conform-0.3.0/wiki/architecture/overview.md +38 -0
- map_conform-0.3.0/wiki/ci-cd/pipeline.md +38 -0
- map_conform-0.3.0/wiki/components/cli-and-tools.md +61 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/components/execution-engines.md +21 -3
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/components/metadata-and-errors.md +11 -6
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/components/name-conformer.md +16 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/components/spec-loader.md +1 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/components/type-system-and-builtins.md +9 -5
- map_conform-0.3.0/wiki/concepts/clean-landing-contract.md +153 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/concepts/existing-systems-survey.md +3 -3
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0002-transform-authoring.md +6 -4
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0005-sdc-metadata.md +3 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0010-stream-map-superset.md +2 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0011-uuid-in-batch.md +3 -2
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/index.md +17 -9
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/log.md +38 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/plans/roadmap.md +10 -3
- map_conform-0.3.0/wiki/qa/benchmarks.md +66 -0
- map_conform-0.3.0/wiki/qa/target-ducklake-clean-landing.md +161 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/qa/test-strategy.md +6 -4
- map_conform-0.3.0/wiki/runbooks/dev-environment.md +131 -0
- map_conform-0.3.0/wiki/runbooks/release.md +72 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/runbooks/wiki-maintenance.md +18 -3
- map_conform-0.3.0/wiki/schemas/conform-spec.md +59 -0
- map_conform-0.3.0/wiki/schemas/plugin-settings.md +41 -0
- map_conform-0.1.0/CHANGELOG.md +0 -47
- map_conform-0.1.0/PKG-INFO +0 -157
- map_conform-0.1.0/README.md +0 -123
- map_conform-0.1.0/conform.yml +0 -9
- map_conform-0.1.0/docs/cookbook.md +0 -257
- map_conform-0.1.0/tests/bench/baseline.json +0 -10
- map_conform-0.1.0/tests/test_cookbook.py +0 -77
- map_conform-0.1.0/wiki/architecture/overview.md +0 -38
- map_conform-0.1.0/wiki/ci-cd/pipeline.md +0 -42
- map_conform-0.1.0/wiki/concepts/clean-landing-contract.md +0 -107
- map_conform-0.1.0/wiki/qa/benchmarks.md +0 -50
- map_conform-0.1.0/wiki/runbooks/dev-environment.md +0 -52
- map_conform-0.1.0/wiki/schemas/conform-spec.md +0 -94
- map_conform-0.1.0/wiki/schemas/plugin-settings.md +0 -42
- {map_conform-0.1.0 → map_conform-0.3.0}/.gitattributes +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.github/agile.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.github/dependabot.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.github/workflows/build.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.github/workflows/run-zizmor.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.gitignore +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.mdformat.toml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/.pre-commit-config.yaml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/LICENSE +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/bin/create-agile-issues.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/bin/render-hub-definition.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/bin/wiki-lint-frontmatter.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/check_lake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/conform.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/data/orders.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/examples/plugins/extractors/tap-csv--meltanolabs.lock +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/__main__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/batch/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/batch/arrow.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/batch/files.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/doctor.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/expr/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/expr/compiler.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/expr/sandbox.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/expr/sdk.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/metadata.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/metrics.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/ascii-table.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/conform.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/flatten.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/nested.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/reserved/ansi.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/reserved/duckdb.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/reserved/postgres.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/reserved/snowflake.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/reserved.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/shape.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/naming/translit.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/ops.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/plan/row.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/rejects.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/settings.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/_struct.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/bridge.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/importer.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/load.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/steps.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/stream_maps.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/spec/zamboni.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/builtins.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/fake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/privacy.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/transforms/text.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/canonical.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/from_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/jsontext.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/to_arrow.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/to_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/types/wire.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/map_conform/udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/plugin-definition.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/batch/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/batch/test_shape_batch.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/bench/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/compare.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/harness.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/sdk_cases.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/test_import.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/test_source_streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/compat/test_translate.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/e2e/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/e2e/test_target_jsonl.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/expr/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/expr/test_compiler.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/expr/test_sandbox.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/expr/test_sdk_corpus.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/README.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/batch/inventory_xlsx-0001.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/batch/orders_export-0001.jsonl.gz +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/batch/orders_export-0001.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/batch/orders_export-0002.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/catalogs/inventory_xlsx.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/catalogs/orders_export.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/catalogs/typed.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/catalogs/typed.expected.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/names.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/temporal.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/text.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/corpus/uuid.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/generate.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/paths.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/sources/orders_export.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/streams/inventory_xlsx.batch-parquet.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/streams/inventory_xlsx.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/streams/orders_export.batch-jsonl.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/streams/orders_export.batch-parquet.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/streams/orders_export.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/udfs/project/project_udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/udfs/site/sample_udfs/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/udfs/site/sample_udfs-0.1.dist-info/METADATA +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/fixtures/udfs/site/sample_udfs-0.1.dist-info/entry_points.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_conform.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_flatten.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_length_collisions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_nested.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_reserved.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_sdk_preset.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_shape.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/naming/test_translit.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/parity/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/parity/harness.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/parity/test_case_parity.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/plan/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/plan/test_expressions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/plan/test_row.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/test_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/test_load.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/spec/test_model.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_bridge.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_doctor.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_fixtures.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_hub_definition.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_mapper.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_metadata.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/test_udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/corpus.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_corpus_casts.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_fake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_masking.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/transforms/test_temporal.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/types/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/types/snapshots/to_jsonschema.json +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/types/test_canonical.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/types/test_type_mappings.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/wiki/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/wiki/pages.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/tests/wiki/test_claims.py +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0001-name-and-licence.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0003-own-spec-with-zamboni-bridge.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0004-batch-engine.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0006-error-policy.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0007-wire-encoding.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0008-naming-defaults.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0009-undeclared-columns.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/decisions/0012-bundled-transliteration-table.md +0 -0
- {map_conform-0.1.0 → map_conform-0.3.0}/wiki/glossary.md +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Bug report
|
|
2
|
+
description: map-conform wrote something it should not have, or failed when it should not.
|
|
3
|
+
labels: ["bug"]
|
|
4
|
+
body:
|
|
5
|
+
- type: input
|
|
6
|
+
id: version
|
|
7
|
+
attributes:
|
|
8
|
+
label: Version
|
|
9
|
+
description: "`map-conform --version`, and the Python version"
|
|
10
|
+
validations:
|
|
11
|
+
required: true
|
|
12
|
+
- type: textarea
|
|
13
|
+
id: spec
|
|
14
|
+
attributes:
|
|
15
|
+
label: Spec and settings
|
|
16
|
+
description: The spec (or the part that matters) and any plugin settings. Remove secrets.
|
|
17
|
+
render: yaml
|
|
18
|
+
validations:
|
|
19
|
+
required: true
|
|
20
|
+
- type: textarea
|
|
21
|
+
id: input
|
|
22
|
+
attributes:
|
|
23
|
+
label: Input
|
|
24
|
+
description: A SCHEMA and a few RECORD messages (or rows) that show the problem. No real personal data.
|
|
25
|
+
render: json
|
|
26
|
+
- type: textarea
|
|
27
|
+
id: actual
|
|
28
|
+
attributes:
|
|
29
|
+
label: What map-conform wrote (or the error)
|
|
30
|
+
validations:
|
|
31
|
+
required: true
|
|
32
|
+
- type: textarea
|
|
33
|
+
id: expected
|
|
34
|
+
attributes:
|
|
35
|
+
label: What you expected
|
|
36
|
+
validations:
|
|
37
|
+
required: true
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Feature or recipe request
|
|
2
|
+
description: Something map-conform should do, or a cookbook recipe that is missing.
|
|
3
|
+
body:
|
|
4
|
+
- type: textarea
|
|
5
|
+
id: problem
|
|
6
|
+
attributes:
|
|
7
|
+
label: The data problem
|
|
8
|
+
description: What your source sends, and what the target should receive.
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: idea
|
|
13
|
+
attributes:
|
|
14
|
+
label: How you would like to declare it
|
|
15
|
+
description: A spec snippet, if you have one in mind.
|
|
16
|
+
render: yaml
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Closes #
|
|
2
|
+
|
|
3
|
+
## What and why
|
|
4
|
+
|
|
5
|
+
## Verification
|
|
6
|
+
|
|
7
|
+
- [ ] `uv run pytest`
|
|
8
|
+
- [ ] `uv run ruff check . && uv run ruff format --check .`
|
|
9
|
+
- [ ] `uv run mypy map_conform tests && uv run ty check`
|
|
10
|
+
- [ ] `uvx pre-commit run --all-files`
|
|
11
|
+
- [ ] Generated files, docs, wiki pages and the changelog's Unreleased section are updated
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
with:
|
|
39
39
|
persist-credentials: false
|
|
40
40
|
- name: Setup uv
|
|
41
|
-
uses: astral-sh/setup-uv@
|
|
41
|
+
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
|
42
42
|
- name: ruff check
|
|
43
43
|
run: uv run --locked --only-group lint ruff check --output-format=github .
|
|
44
44
|
- name: ruff format
|
|
@@ -54,7 +54,7 @@ jobs:
|
|
|
54
54
|
with:
|
|
55
55
|
persist-credentials: false
|
|
56
56
|
- name: Setup uv
|
|
57
|
-
uses: astral-sh/setup-uv@
|
|
57
|
+
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
|
58
58
|
- name: mypy and ty
|
|
59
59
|
run: uvx --managed-python --with=tox-uv tox -e typing
|
|
60
60
|
|
|
@@ -72,13 +72,14 @@ jobs:
|
|
|
72
72
|
fetch-depth: 0 # hatch-vcs derives the version from tags
|
|
73
73
|
persist-credentials: false
|
|
74
74
|
- name: Setup uv
|
|
75
|
-
uses: astral-sh/setup-uv@
|
|
75
|
+
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
|
76
76
|
with:
|
|
77
77
|
python-version: ${{ matrix.python-version }}
|
|
78
78
|
- name: Run tox
|
|
79
79
|
env:
|
|
80
80
|
PYTHON_VERSION: ${{ matrix.python-version }}
|
|
81
|
-
|
|
81
|
+
# -m overrides the default "not bench and not e2e", so e2e runs here too.
|
|
82
|
+
run: uvx --with=tox-uv tox -e "$PYTHON_VERSION" -- tests -m "not bench"
|
|
82
83
|
|
|
83
84
|
bench:
|
|
84
85
|
name: Benchmarks
|
|
@@ -89,7 +90,7 @@ jobs:
|
|
|
89
90
|
fetch-depth: 0 # hatch-vcs derives the version from tags
|
|
90
91
|
persist-credentials: false
|
|
91
92
|
- name: Setup uv
|
|
92
|
-
uses: astral-sh/setup-uv@
|
|
93
|
+
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
|
93
94
|
with:
|
|
94
95
|
python-version: "3.14"
|
|
95
96
|
- name: Throughput and regression gate
|
|
@@ -109,7 +110,7 @@ jobs:
|
|
|
109
110
|
fetch-depth: 0 # hatch-vcs derives the version from tags
|
|
110
111
|
persist-credentials: false
|
|
111
112
|
- name: Setup uv
|
|
112
|
-
uses: astral-sh/setup-uv@
|
|
113
|
+
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
|
|
113
114
|
with:
|
|
114
115
|
python-version: "3.12"
|
|
115
116
|
- name: meltano install
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to map-conform are recorded here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
|
|
5
|
+
[Semantic Versioning](https://semver.org/). Before 1.0, a minor version may change behaviour;
|
|
6
|
+
each such change is listed.
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-11-30
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- The Clean-Landing Contract has a copy-ready reviewer snippet for target repos, in two
|
|
13
|
+
variants: for a target always behind map-conform, and for one that keeps its own cleanup
|
|
14
|
+
options for other pipelines. The README links it.
|
|
15
|
+
- The `int16`/`int32`/`int64` casts also read PostgreSQL integer literals: `0x`, `0o` and
|
|
16
|
+
`0b` prefixes in any case (`0x1F`, `-0b101`, `0x_1F`) and single underscores between
|
|
17
|
+
digits (`1_000`). The rest of the numeric grammar is unchanged.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **Breaking:** `to_int()` reads text as PostgreSQL reads a `bigint`: optional whitespace and
|
|
22
|
+
sign, then decimal digits or a `0x`/`0o`/`0b` literal, with single underscores between
|
|
23
|
+
digits. It no longer accepts `"7.0"` or `"1e3"`; use `round()`, `floor()` or `ceil()` for
|
|
24
|
+
those. As a `bigint`, it refuses a value outside the 64-bit range (-2**63 to 2**63 - 1),
|
|
25
|
+
from text or a number; use `to_decimal()` for wider integers. `to_int(True)` is 1 and `to_int(False)` is 0 (they were errors), so
|
|
26
|
+
`to_int(to_bool(x))` lands 1 or 0 in a target with no boolean type. A non-finite float
|
|
27
|
+
is now a step error rather than a crash.
|
|
28
|
+
- Booleans follow one rule in `to_bool()` and the `boolean` cast (row and columnar): the
|
|
29
|
+
words, in any case, and then a number or numeric text as a counter: 0 or less is false,
|
|
30
|
+
more than 0 true. So `2`, `"2"` and `"1.0"` are true and `-1`, `"-0.5"` and `"0.0"` false,
|
|
31
|
+
where only 0 and 1 were accepted before. NaN is still an error.
|
|
32
|
+
- **Breaking:** a key property's column is never nullable, however it is declared or the
|
|
33
|
+
tap types it: the output SCHEMA and Arrow schema mark it non-null, and a null or missing
|
|
34
|
+
key fails the run, as a null in any `nullable: false` column does. Before, a key column
|
|
35
|
+
declared without `nullable: false`, or typed nullable by the tap, let a null key through,
|
|
36
|
+
which a merge can't match and a primary key refuses. `set_null` on a key column is a spec
|
|
37
|
+
error.
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
|
|
41
|
+
- A boolean member of a `struct` or `list` read only `true` and `false`. It now reads the
|
|
42
|
+
spec's `boolean` words (`yes`, `on`, `t`, ... in any case, surrounding ASCII whitespace
|
|
43
|
+
ignored) and then numbers as counters, as a boolean column does.
|
|
44
|
+
|
|
45
|
+
## [0.2.0] - 2026-11-23
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- The spec reference lists every `parse` option for each type, with its default, and the
|
|
50
|
+
date format keywords, all generated from the code.
|
|
51
|
+
- Cookbook recipes for European and Swiss formats, bad values and the rejects file, hashes
|
|
52
|
+
and fake names, parquet BATCH files, nested objects, the `_sdc_*` columns, moving from
|
|
53
|
+
stream maps (with the output differences), and how a spec is applied.
|
|
54
|
+
- `engine: row` (in `defaults`, a stream or a column) runs parquet BATCH files row by row:
|
|
55
|
+
the reference to compare a vectorised result against.
|
|
56
|
+
- The mapper logs whether each stream's BATCH files run columnar or row-wise, and why
|
|
57
|
+
(INFO once per stream, DEBUG per file).
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- A column's `flatten: true` without a `shape` was ignored. It now flattens the column
|
|
62
|
+
from the tap's schema, whatever `nested` is; its leaf columns can be declared.
|
|
63
|
+
|
|
64
|
+
- Configuration errors start "Problems in" and name the file or plan, instead of "Invalid".
|
|
65
|
+
|
|
66
|
+
- A vector cast now hands every value to the row path when an option it does not implement
|
|
67
|
+
is set, instead of relying on a hand-kept list of grammar options.
|
|
68
|
+
|
|
69
|
+
- The default `pytest` run no longer needs the network: the e2e test is opt-in
|
|
70
|
+
(`-m e2e`), and CI runs it in the test matrix.
|
|
71
|
+
|
|
72
|
+
- A `|` in a spec reference cell no longer splits its table row.
|
|
73
|
+
|
|
74
|
+
- `spec validate` compiles every plan, so a typo in a step or `parse` option, an unknown
|
|
75
|
+
step or name, or a type mismatch fails validation rather than the run. Without
|
|
76
|
+
`--catalog`, problems in a tap column with no declared type are warnings. It takes
|
|
77
|
+
`--allow-python-udfs`, as `spec explain` does.
|
|
78
|
+
|
|
79
|
+
- A problem with a `parse` option is reported at `columns.<c>.parse.<key>`, not under
|
|
80
|
+
`transform`.
|
|
81
|
+
|
|
82
|
+
- `map-conform functions` reported no step as vectorised. It now lists the engines that
|
|
83
|
+
vectorise each step and cast (`engines`, `cast_engines` in `--json`), from the kernel
|
|
84
|
+
tables themselves.
|
|
85
|
+
|
|
86
|
+
## [0.1.0] - 2026-11-23
|
|
87
|
+
|
|
88
|
+
The first release: a Singer/Meltano inline mapper that conforms names, types, values and
|
|
89
|
+
metadata so targets receive clean data.
|
|
90
|
+
|
|
91
|
+
### Added
|
|
92
|
+
|
|
93
|
+
- **Conform spec** (YAML or JSON, `spec_path` or inline): strict parsing with every problem
|
|
94
|
+
reported at its path, `${var}` and `${env:NAME}` substitution, inheritance from
|
|
95
|
+
`defaults` through stream globs to exact names, macros with parameters, and a generated
|
|
96
|
+
JSON Schema (`map-conform spec schema`).
|
|
97
|
+
- **Types and casts** to declared canonical types: integers, floats, exact decimals,
|
|
98
|
+
strings, booleans, dates, times, timestamps with and without zone, UUIDs, binary, JSON,
|
|
99
|
+
structs and lists. The casts clean text on the way: currency, thousands separators,
|
|
100
|
+
accounting negatives, percentages, locales, null tokens, Excel serial dates, epoch times,
|
|
101
|
+
time zones with DST policies, yes/no words.
|
|
102
|
+
- **Name conforming**: snake_case with camelCase splitting, ASCII transliteration with a
|
|
103
|
+
bundled table, reserved words of PostgreSQL, DuckDB and Snowflake, length limits with hash
|
|
104
|
+
truncation, collision checks, nested member names, stream prefixes and aliases, and the
|
|
105
|
+
`naming: sdk` preset matching the Singer SDK byte for byte.
|
|
106
|
+
- **Builtin steps** for text, numbers, temporals, privacy (hash, mask, set_null,
|
|
107
|
+
redact_date, mask_number, mask_hidden, tokenize) and fake data (the `faker` extra).
|
|
108
|
+
- **Expressions**: a sandboxed Python subset compiled once per column, with a function
|
|
109
|
+
library; `expr`, `case` and `when` steps; derived columns in dependency order; stream
|
|
110
|
+
`filter`; `fields` for nested members; UDFs from installed packages or, opted in, from
|
|
111
|
+
project modules.
|
|
112
|
+
- **Errors**: `on_error` (`raise`, `null`, `keep`, `reject`), a reject sink (JSONL or
|
|
113
|
+
parquet), reject and null rate limits checked before each STATE, and per-stream metrics.
|
|
114
|
+
- **`_sdc_*` metadata columns** with Singer SDK semantics, when `add_record_metadata` is
|
|
115
|
+
true.
|
|
116
|
+
- **BATCH**: parquet and JSONL manifests over fsspec, conformed into new files with the
|
|
117
|
+
declared Arrow schema, or into RECORD messages; a columnar Arrow engine that gives exactly
|
|
118
|
+
the row path's results, `case` lowering, and the `polars` engine (extra).
|
|
119
|
+
- **Flattening** with Singer SDK semantics, and from a declared JSON `shape` that keeps the
|
|
120
|
+
output schema stable when the tap's schema drifts.
|
|
121
|
+
- **SDK compatibility**: `stream_maps`, `stream_map_config`, `faker_config` and
|
|
122
|
+
`flattening_*` settings accepted unchanged, checked against the SDK's own mapper tests.
|
|
123
|
+
- **Tools**: `spec validate`, `spec explain`, `spec import` (from a catalog, Zamboni
|
|
124
|
+
`columns` or SDK stream maps), `spec export --zamboni`, `doctor` and `functions`.
|
|
125
|
+
- **Docs**: README, a generated spec reference, and a cookbook whose examples are tested.
|
|
@@ -5,7 +5,8 @@ customer data or credentials** in code, docs, commits, issues or PRs.
|
|
|
5
5
|
|
|
6
6
|
## Orientation
|
|
7
7
|
|
|
8
|
-
- Founding brief: `creating-a-better-mapper-guidance.md`
|
|
8
|
+
- Founding brief (the original intent, kept as a record): `creating-a-better-mapper-guidance.md`
|
|
9
|
+
- Contributor workflow: `CONTRIBUTING.md`; releases: `wiki/runbooks/release.md`
|
|
9
10
|
- Design docs: `docs/` (exec overview, HLD, detailed design, plan/WBS)
|
|
10
11
|
- Knowledge base: `wiki/`. Read `wiki/runbooks/wiki-maintenance.md` before editing anything
|
|
11
12
|
under `wiki/`.
|
|
@@ -25,9 +26,8 @@ customer data or credentials** in code, docs, commits, issues or PRs.
|
|
|
25
26
|
|
|
26
27
|
## Workflow
|
|
27
28
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
- Wiki content syncs happen on `main` after a merge (see the maintenance runbook), with a
|
|
29
|
+
- Push only to `origin`; work lands through pull requests.
|
|
30
|
+
- Before calling work done: the definition of done in `wiki/runbooks/dev-environment.md`
|
|
31
|
+
(tests, ruff, mypy and ty, pre-commit, generated files, docs, wiki and changelog).
|
|
32
|
+
- Wiki changes go in the same pull request as the code (see the maintenance runbook), with a
|
|
33
33
|
`wiki/log.md` row for each page change.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Contributing to map-conform
|
|
2
|
+
|
|
3
|
+
Thank you for helping. Bug reports, recipes that should be in the cookbook, and pull requests
|
|
4
|
+
are all welcome.
|
|
5
|
+
|
|
6
|
+
## Reporting a bug
|
|
7
|
+
|
|
8
|
+
Open an issue with:
|
|
9
|
+
|
|
10
|
+
- the map-conform version (`map-conform --version`) and Python version;
|
|
11
|
+
- the spec (or the part that matters) and the settings;
|
|
12
|
+
- a few input records, or the SCHEMA and a RECORD, that show the problem;
|
|
13
|
+
- what map-conform wrote, and what you expected.
|
|
14
|
+
|
|
15
|
+
`map-conform spec validate` and `map-conform spec explain --catalog` often show the cause.
|
|
16
|
+
For a security problem, do not open an issue: see [SECURITY.md](SECURITY.md).
|
|
17
|
+
|
|
18
|
+
## Setting up
|
|
19
|
+
|
|
20
|
+
The [dev environment runbook](wiki/runbooks/dev-environment.md) has the commands: `uv sync --all-groups`, the tests, lint and types, and the checklists for adding a step, a cast option,
|
|
21
|
+
a setting or a type. The [wiki](wiki/index.md) explains how the code is organised, and
|
|
22
|
+
[docs/detailed-design.md](docs/detailed-design.md) why it behaves as it does.
|
|
23
|
+
|
|
24
|
+
## How work is tracked
|
|
25
|
+
|
|
26
|
+
Work is tracked as GitHub issues on this repository, organised on a GitHub Project by the
|
|
27
|
+
[`gh agile`](https://github.com/paulcaron16k/gh-agile) extension, which labels each issue
|
|
28
|
+
with a key, `MAPC-<number>` (the number is the issue number). You do not need it to
|
|
29
|
+
contribute: open an issue or a pull request as usual, and a maintainer files it on the
|
|
30
|
+
board. To use it yourself: `gh extension install paulcaron16k/gh-agile`; the profile is
|
|
31
|
+
[.github/agile.json](.github/agile.json), and `gh agile validate` checks the board.
|
|
32
|
+
|
|
33
|
+
## Branches, commits and pull requests
|
|
34
|
+
|
|
35
|
+
- **Branches:** `<kind>/mapc-<n>_<slug>`, where kind is `feat`, `fix`, `docs`, `chore`, `ci`
|
|
36
|
+
or `release`, e.g. `fix/mapc-141_column-flatten`.
|
|
37
|
+
- **Commits:** an imperative subject that ends with the issue key, e.g.
|
|
38
|
+
`Honour a column's flatten: true without a shape (MAPC-141)`; a body that says what
|
|
39
|
+
changed and why.
|
|
40
|
+
- **Pull requests:** one issue per pull request, `Closes #<n>` in the description, what
|
|
41
|
+
changed, and how it was verified. Pull requests are squash-merged, so the subject becomes
|
|
42
|
+
the commit on `main`.
|
|
43
|
+
- **Done** means the [definition of done](wiki/runbooks/dev-environment.md#definition-of-done):
|
|
44
|
+
tests, lint, types and pre-commit pass, generated files are current, and the docs, the
|
|
45
|
+
wiki pages and the changelog's Unreleased section describe the change. CI checks the rest.
|
|
46
|
+
- **The wiki** changes in the same pull request as the code it describes. Its rules are in
|
|
47
|
+
[wiki maintenance](wiki/runbooks/wiki-maintenance.md).
|
|
48
|
+
- **Design decisions** are ADRs in [wiki/decisions/](wiki/decisions/0001-name-and-licence.md);
|
|
49
|
+
changing the [Clean-Landing Contract](wiki/concepts/clean-landing-contract.md), which
|
|
50
|
+
targets rely on, always needs one.
|
|
51
|
+
|
|
52
|
+
## Licence
|
|
53
|
+
|
|
54
|
+
By contributing you agree that your contributions are licensed under the
|
|
55
|
+
[Apache License 2.0](LICENSE), like the rest of the project.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: map-conform
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: A Singer inline mapper that conforms names, types, values and metadata so data lands clean.
|
|
5
|
+
Project-URL: Homepage, https://github.com/paulcaron16k/map-conform
|
|
6
|
+
Project-URL: Documentation, https://github.com/paulcaron16k/map-conform/tree/main/docs
|
|
7
|
+
Project-URL: Issues, https://github.com/paulcaron16k/map-conform/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/paulcaron16k/map-conform/blob/main/CHANGELOG.md
|
|
9
|
+
Author-email: Paul Caron <paulcaron16k@yahoo.com>
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ELT,Meltano,Singer,data cleaning,mapper
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Database
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Requires-Dist: fsspec>=2024.2
|
|
23
|
+
Requires-Dist: pyarrow>=18
|
|
24
|
+
Requires-Dist: pyyaml>=6
|
|
25
|
+
Requires-Dist: singer-sdk~=0.54.9
|
|
26
|
+
Requires-Dist: typing-extensions>=4.5.0; python_version < '3.13'
|
|
27
|
+
Provides-Extra: faker
|
|
28
|
+
Requires-Dist: singer-sdk[faker]; extra == 'faker'
|
|
29
|
+
Provides-Extra: polars
|
|
30
|
+
Requires-Dist: polars>=1.20; extra == 'polars'
|
|
31
|
+
Provides-Extra: s3
|
|
32
|
+
Requires-Dist: s3fs>=2026.1.0; extra == 's3'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# map-conform
|
|
36
|
+
|
|
37
|
+
[](https://pypi.org/project/map-conform/)
|
|
38
|
+
[](https://pypi.org/project/map-conform/)
|
|
39
|
+
[](https://github.com/paulcaron16k/map-conform/actions/workflows/test.yml)
|
|
40
|
+
[](https://github.com/paulcaron16k/map-conform/blob/main/LICENSE)
|
|
41
|
+
[](https://github.com/astral-sh/ruff)
|
|
42
|
+
|
|
43
|
+
A Singer/Meltano **inline mapper** that makes data *land clean*. It sits between any tap and
|
|
44
|
+
any target and, once, upstream:
|
|
45
|
+
|
|
46
|
+
- **casts to declared types**, never guessed: exact decimals, dates, timestamps in UTC,
|
|
47
|
+
booleans, UUIDs, JSON, structs and lists;
|
|
48
|
+
- **cleans values on the way**: currency symbols, thousands separators (US, European and
|
|
49
|
+
Swiss), accounting negatives, percentages, null tokens (`N/A`, `#N/A`, `-`), spreadsheet
|
|
50
|
+
serial dates, epoch times, time zones and DST, yes/no words;
|
|
51
|
+
- **conforms names** of streams, columns and nested members so every target accepts them:
|
|
52
|
+
snake_case, ASCII, length limits, reserved words, collision checks;
|
|
53
|
+
- **masks personal data**: hashes, keyed tokens, partial masks, redacted dates, fake values,
|
|
54
|
+
nulls, with conditions and nested paths;
|
|
55
|
+
- **computes columns and filters rows** with a safe expression language, macros and UDFs;
|
|
56
|
+
- **sets bad values aside** instead of crashing, if you ask: null them, keep them, or reject
|
|
57
|
+
the row to a file you can replay;
|
|
58
|
+
- **conforms BATCH files** (parquet or JSONL), with Arrow kernels for parquet and optionally
|
|
59
|
+
polars;
|
|
60
|
+
- **adds the `_sdc_*` metadata columns** with Singer SDK semantics, when asked;
|
|
61
|
+
- **accepts SDK `stream_maps` settings unchanged**, so meltano-map-transformer projects move
|
|
62
|
+
over without changes.
|
|
63
|
+
|
|
64
|
+
Targets can then rely on the [Clean-Landing Contract](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md):
|
|
65
|
+
what every record, SCHEMA and BATCH file from map-conform guarantees, so a target writes data
|
|
66
|
+
instead of cleaning it. Target maintainers can paste its
|
|
67
|
+
[reviewer snippet](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md#7-reviewer-instruction-for-target-repos)
|
|
68
|
+
into their review rules, so reviewers stop asking for cleanup the mapper already did.
|
|
69
|
+
|
|
70
|
+
## Why
|
|
71
|
+
|
|
72
|
+
Every Singer target cleans data a little differently, so the same CSV lands with different
|
|
73
|
+
values depending on where it goes, and BATCH data skips the SDK's per-record cleanup
|
|
74
|
+
altogether. The common fallback, a cleanup layer in dbt, is SQL only, needs macros that work
|
|
75
|
+
across every warehouse a project uses, and runs after the raw data, mess and personal data
|
|
76
|
+
included, has landed. map-conform does the cleanup once, in Python, before anything is
|
|
77
|
+
stored: exact decimals, real date parsing, Unicode-aware names and masking, for every target.
|
|
78
|
+
|
|
79
|
+
Compared with meltano-map-transformer (SDK stream maps), which renames, filters and computes
|
|
80
|
+
columns but takes types from expression prefixes and crashes on a bad value, map-conform
|
|
81
|
+
declares each column's type, cleans and casts the value, handles bad values by policy, and
|
|
82
|
+
conforms BATCH messages. Stream maps keep working ([migration](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md#moving-from-sdk-stream-maps)).
|
|
83
|
+
|
|
84
|
+
## Install
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install map-conform # the mapper
|
|
88
|
+
pip install 'map-conform[faker]' # + fake data for masking
|
|
89
|
+
pip install 'map-conform[polars]' # + the polars engine (regex, strptime formats)
|
|
90
|
+
pip install 'map-conform[s3]' # + BATCH files on S3
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Python 3.11 to 3.14.
|
|
94
|
+
|
|
95
|
+
## Use it in Meltano
|
|
96
|
+
|
|
97
|
+
map-conform is not on Meltano Hub yet, so add it as a custom mapper (`namespace` is what
|
|
98
|
+
makes it custom):
|
|
99
|
+
|
|
100
|
+
```yaml
|
|
101
|
+
plugins:
|
|
102
|
+
mappers:
|
|
103
|
+
- name: map-conform
|
|
104
|
+
namespace: map_conform
|
|
105
|
+
pip_url: map-conform
|
|
106
|
+
executable: map-conform
|
|
107
|
+
mappings:
|
|
108
|
+
- name: conform
|
|
109
|
+
config:
|
|
110
|
+
spec_path: conform.yml
|
|
111
|
+
add_record_metadata: true # add the _sdc_* columns
|
|
112
|
+
loaders:
|
|
113
|
+
- name: target-postgres
|
|
114
|
+
config:
|
|
115
|
+
add_record_metadata: true # so the SDK target keeps them
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
meltano run tap-csv conform target-postgres
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Any setting can go in the mapping's `config`. To set them with `meltano config` or
|
|
123
|
+
environment variables, declare them under the plugin's `settings:` too;
|
|
124
|
+
[plugin-definition.yml](https://github.com/paulcaron16k/map-conform/blob/main/plugin-definition.yml)
|
|
125
|
+
lists every one, and `map-conform --about` describes them.
|
|
126
|
+
|
|
127
|
+
A spec (`conform.yml`) declares what the data should look like:
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
version: 1
|
|
131
|
+
defaults:
|
|
132
|
+
on_error: reject # bad rows go to ./.map-conform/rejects, the run goes on
|
|
133
|
+
streams:
|
|
134
|
+
Orders Export:
|
|
135
|
+
key_properties: [order_id]
|
|
136
|
+
columns:
|
|
137
|
+
Order ID: {name: order_id, type: int64, nullable: false}
|
|
138
|
+
Amount ($): {type: "decimal(12,2)", parse: {parens_negative: true}}
|
|
139
|
+
Order Date: {type: date, parse: {formats: ["%m/%d/%Y", iso, excel_serial]}}
|
|
140
|
+
Customer Email: {transform: {hash: {salt: "${env:EMAIL_SALT}"}}}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`"$1,234.50"` lands as `1234.50`, `"(12.00)"` as `-12.00`, `"03/14/2026"` and `46095` as
|
|
144
|
+
`2026-03-14`, `Order ID` as `order_id` and `Amount ($)` as `amount`; the stream lands as
|
|
145
|
+
`orders_export` (`stream: {name: preserve}` keeps tap stream names). Columns the spec does
|
|
146
|
+
not mention are conformed from the tap's SCHEMA. Without a spec at all, map-conform conforms
|
|
147
|
+
names and types with its defaults.
|
|
148
|
+
|
|
149
|
+
Without `on_error`, a value that cannot be cast stops the run with the stream, column, row
|
|
150
|
+
and value: nothing lands wrong silently. Check a spec before running it with
|
|
151
|
+
`map-conform spec validate conform.yml`, and a project with `map-conform doctor`.
|
|
152
|
+
|
|
153
|
+
## Documentation
|
|
154
|
+
|
|
155
|
+
- [Cookbook](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md):
|
|
156
|
+
CSV, spreadsheet and European exports, bad values and rejects, epoch times, hashes and
|
|
157
|
+
fake names, masking, derived columns, parquet BATCH files, nested objects and declared
|
|
158
|
+
shapes, the `_sdc_*` columns, and moving from stream maps. Every example is run by the
|
|
159
|
+
test suite.
|
|
160
|
+
- [Spec reference](https://github.com/paulcaron16k/map-conform/blob/main/docs/spec-reference.md):
|
|
161
|
+
every setting, spec key, `parse` option, step and function, generated from the code.
|
|
162
|
+
- [Detailed design](https://github.com/paulcaron16k/map-conform/blob/main/docs/detailed-design.md): how each feature behaves, and why.
|
|
163
|
+
- [Clean-Landing Contract](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md): what a target may assume, and a reviewer snippet for target repos.
|
|
164
|
+
- The project's knowledge base is in [wiki/](https://github.com/paulcaron16k/map-conform/blob/main/wiki/index.md).
|
|
165
|
+
|
|
166
|
+
## Command line
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
map-conform --config config.json < tap-output.jsonl # the mapper (Singer SDK CLI)
|
|
170
|
+
map-conform spec validate conform.yml --catalog catalog.json
|
|
171
|
+
map-conform spec explain conform.yml --stream "Orders Export" --catalog catalog.json
|
|
172
|
+
map-conform spec import --catalog catalog.json > conform.yml # draft a spec
|
|
173
|
+
map-conform spec import --stream-maps config.json > conform.yml # from SDK stream maps
|
|
174
|
+
map-conform spec export conform.yml --zamboni table-config.json --catalog catalog.json
|
|
175
|
+
map-conform spec schema > conform.schema.json # for editor completion
|
|
176
|
+
map-conform doctor --meltano-yml meltano.yml
|
|
177
|
+
map-conform functions # steps, casts, functions
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
A catalog is what the tap discovers (`meltano invoke tap-csv --discover > catalog.json`);
|
|
181
|
+
with it, `spec validate` and `spec explain` check the spec against the tap's real columns
|
|
182
|
+
and types. `spec export --zamboni` writes each column's type into a
|
|
183
|
+
[Zamboni](https://github.com/paulcaron16k/Zamboni) table-config, the layout and
|
|
184
|
+
maintenance spec of its Iceberg tables; skip it if you do not use Zamboni.
|
|
185
|
+
|
|
186
|
+
## Development
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
uv sync --all-groups
|
|
190
|
+
uv run pytest
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
[CONTRIBUTING.md](https://github.com/paulcaron16k/map-conform/blob/main/CONTRIBUTING.md) has
|
|
194
|
+
the workflow, and the
|
|
195
|
+
[dev environment runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/dev-environment.md)
|
|
196
|
+
the checks that make a change done, the generated files, and checklists for adding a step,
|
|
197
|
+
an option, a setting or a type. Releases follow the
|
|
198
|
+
[release runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/release.md).
|
|
199
|
+
Security problems: [SECURITY.md](https://github.com/paulcaron16k/map-conform/blob/main/SECURITY.md).
|
|
200
|
+
|
|
201
|
+
## Licence
|
|
202
|
+
|
|
203
|
+
Apache-2.0
|