map-conform 0.1.0__tar.gz → 0.2.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.2.0/.github/ISSUE_TEMPLATE/bug.yml +37 -0
- map_conform-0.2.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- map_conform-0.2.0/.github/ISSUE_TEMPLATE/feature.yml +16 -0
- map_conform-0.2.0/.github/pull_request_template.md +11 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.github/workflows/test.yml +2 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/CHANGELOG.md +41 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/CLAUDE.md +6 -6
- map_conform-0.2.0/CONTRIBUTING.md +55 -0
- map_conform-0.2.0/PKG-INFO +201 -0
- map_conform-0.2.0/README.md +167 -0
- map_conform-0.2.0/SECURITY.md +42 -0
- map_conform-0.2.0/conform.yml +9 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/creating-a-better-mapper-guidance.md +93 -84
- {map_conform-0.1.0 → map_conform-0.2.0}/docs/architecture-hld.md +83 -46
- map_conform-0.2.0/docs/cookbook.md +616 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/docs/detailed-design.md +142 -99
- {map_conform-0.1.0 → map_conform-0.2.0}/docs/exec-overview.md +28 -17
- {map_conform-0.1.0 → map_conform-0.2.0}/docs/plan-wbs.md +18 -9
- {map_conform-0.1.0 → map_conform-0.2.0}/docs/spec-reference.md +110 -4
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/README.md +21 -3
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/meltano.yml +7 -4
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/batch/columnar.py +17 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/batch/engine.py +43 -10
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/cli.py +52 -13
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/map-conform-spec.schema.json +8 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/mapper.py +3 -3
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/chain.py +27 -8
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/compile.py +59 -11
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/lower.py +20 -0
- map_conform-0.2.0/map_conform/plan/validate.py +171 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/vector.py +3 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/check.py +3 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/model.py +9 -6
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/reference.py +39 -6
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/casts.py +48 -15
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/nested.py +2 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/numeric.py +20 -8
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/polars_vector.py +3 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/registry.py +0 -6
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/temporal.py +35 -20
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/vector.py +55 -12
- {map_conform-0.1.0 → map_conform-0.2.0}/meltano.yml +5 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/pyproject.toml +1 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/batch/test_batch.py +44 -0
- map_conform-0.2.0/tests/bench/baseline.json +10 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/bench/test_bench.py +24 -10
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/bench/workload.py +3 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/test_sdk_parity.py +6 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/parity/test_parity.py +28 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/parity/test_polars_parity.py +8 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/plan/test_chain.py +1 -3
- map_conform-0.2.0/tests/plan/test_column_flatten.py +115 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/test_check.py +82 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/test_reference.py +13 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_cli.py +25 -0
- map_conform-0.2.0/tests/test_contract.py +103 -0
- map_conform-0.2.0/tests/test_cookbook.py +133 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_settings.py +1 -1
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_undeclared.py +1 -1
- map_conform-0.2.0/tests/transforms/test_vector_claims.py +74 -0
- map_conform-0.2.0/wiki/architecture/overview.md +38 -0
- map_conform-0.2.0/wiki/ci-cd/pipeline.md +38 -0
- map_conform-0.2.0/wiki/components/cli-and-tools.md +61 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/components/execution-engines.md +21 -3
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/components/metadata-and-errors.md +11 -6
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/components/name-conformer.md +16 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/components/spec-loader.md +1 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/components/type-system-and-builtins.md +9 -5
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/concepts/clean-landing-contract.md +23 -8
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/concepts/existing-systems-survey.md +3 -3
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0002-transform-authoring.md +6 -4
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0005-sdc-metadata.md +3 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0010-stream-map-superset.md +2 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0011-uuid-in-batch.md +3 -2
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/index.md +16 -9
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/log.md +27 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/plans/roadmap.md +10 -3
- map_conform-0.2.0/wiki/qa/benchmarks.md +66 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/qa/test-strategy.md +5 -3
- map_conform-0.2.0/wiki/runbooks/dev-environment.md +131 -0
- map_conform-0.2.0/wiki/runbooks/release.md +72 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/runbooks/wiki-maintenance.md +18 -3
- map_conform-0.2.0/wiki/schemas/conform-spec.md +59 -0
- map_conform-0.2.0/wiki/schemas/plugin-settings.md +41 -0
- 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/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.2.0}/.gitattributes +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.github/agile.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.github/dependabot.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.github/workflows/build.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.github/workflows/run-zizmor.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.gitignore +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.mdformat.toml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/.pre-commit-config.yaml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/LICENSE +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/_typos.toml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/bin/create-agile-issues.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/bin/render-hub-definition.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/bin/wiki-lint-frontmatter.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/check_lake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/conform.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/data/orders.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/examples/plugins/extractors/tap-csv--meltanolabs.lock +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/__main__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/batch/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/batch/arrow.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/batch/files.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/doctor.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/expr/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/expr/compiler.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/expr/functions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/expr/sandbox.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/expr/sdk.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/metadata.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/metrics.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/ascii-table.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/conform.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/flatten.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/nested.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/reserved/ansi.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/reserved/duckdb.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/reserved/postgres.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/reserved/snowflake.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/reserved.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/shape.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/naming/translit.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/ops.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/plan/row.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/rejects.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/settings.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/_struct.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/bridge.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/importer.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/load.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/steps.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/stream_maps.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/spec/zamboni.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/builtins.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/fake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/privacy.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/transforms/text.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/canonical.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/from_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/jsontext.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/to_arrow.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/to_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/types/wire.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/map_conform/udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/plugin-definition.yml +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/batch/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/batch/test_shape_batch.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/bench/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/compare.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/harness.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/sdk_cases.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/test_import.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/test_source_streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/compat/test_translate.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/e2e/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/e2e/test_target_jsonl.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/expr/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/expr/test_compiler.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/expr/test_functions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/expr/test_sandbox.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/expr/test_sdk_corpus.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/README.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/batch/inventory_xlsx-0001.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/batch/orders_export-0001.jsonl.gz +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/batch/orders_export-0001.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/batch/orders_export-0002.parquet +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/catalogs/inventory_xlsx.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/catalogs/orders_export.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/catalogs/typed.catalog.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/catalogs/typed.expected.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/boolean.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/names.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/numeric.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/temporal.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/text.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/corpus/uuid.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/generate.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/paths.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/sources/orders_export.csv +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/streams/inventory_xlsx.batch-parquet.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/streams/inventory_xlsx.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/streams/orders_export.batch-jsonl.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/streams/orders_export.batch-parquet.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/streams/orders_export.singer.jsonl +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/udfs/project/project_udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/udfs/site/sample_udfs/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/udfs/site/sample_udfs-0.1.dist-info/METADATA +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/fixtures/udfs/site/sample_udfs-0.1.dist-info/entry_points.txt +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_conform.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_flatten.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_length_collisions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_nested.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_reserved.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_sdk_preset.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_shape.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_streams.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/naming/test_translit.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/parity/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/parity/harness.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/parity/test_case_parity.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/plan/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/plan/test_compile.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/plan/test_expressions.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/plan/test_row.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/test_jsonschema.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/test_load.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/spec/test_model.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_bridge.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_doctor.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_errors.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_fixtures.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_hub_definition.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_mapper.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_metadata.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_rejects_metrics.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/test_udfs.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/corpus.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_builtins.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_corpus_casts.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_fake.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_masking.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_numeric.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/transforms/test_temporal.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/types/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/types/snapshots/to_jsonschema.json +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/types/test_canonical.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/types/test_type_mappings.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/wiki/__init__.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/wiki/pages.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/tests/wiki/test_claims.py +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/uv.lock +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0001-name-and-licence.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0003-own-spec-with-zamboni-bridge.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0004-batch-engine.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0006-error-policy.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0007-wire-encoding.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0008-naming-defaults.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0009-undeclared-columns.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.0}/wiki/decisions/0012-bundled-transliteration-table.md +0 -0
- {map_conform-0.1.0 → map_conform-0.2.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
|
|
@@ -78,7 +78,8 @@ jobs:
|
|
|
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
|
|
@@ -5,6 +5,47 @@ All notable changes to map-conform are recorded here. The format follows
|
|
|
5
5
|
[Semantic Versioning](https://semver.org/). Before 1.0, a minor version may change behaviour;
|
|
6
6
|
each such change is listed.
|
|
7
7
|
|
|
8
|
+
## [0.2.0] - 2026-11-23
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- The spec reference lists every `parse` option for each type, with its default, and the
|
|
13
|
+
date format keywords, all generated from the code.
|
|
14
|
+
- Cookbook recipes for European and Swiss formats, bad values and the rejects file, hashes
|
|
15
|
+
and fake names, parquet BATCH files, nested objects, the `_sdc_*` columns, moving from
|
|
16
|
+
stream maps (with the output differences), and how a spec is applied.
|
|
17
|
+
- `engine: row` (in `defaults`, a stream or a column) runs parquet BATCH files row by row:
|
|
18
|
+
the reference to compare a vectorised result against.
|
|
19
|
+
- The mapper logs whether each stream's BATCH files run columnar or row-wise, and why
|
|
20
|
+
(INFO once per stream, DEBUG per file).
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- A column's `flatten: true` without a `shape` was ignored. It now flattens the column
|
|
25
|
+
from the tap's schema, whatever `nested` is; its leaf columns can be declared.
|
|
26
|
+
|
|
27
|
+
- Configuration errors start "Problems in" and name the file or plan, instead of "Invalid".
|
|
28
|
+
|
|
29
|
+
- A vector cast now hands every value to the row path when an option it does not implement
|
|
30
|
+
is set, instead of relying on a hand-kept list of grammar options.
|
|
31
|
+
|
|
32
|
+
- The default `pytest` run no longer needs the network: the e2e test is opt-in
|
|
33
|
+
(`-m e2e`), and CI runs it in the test matrix.
|
|
34
|
+
|
|
35
|
+
- A `|` in a spec reference cell no longer splits its table row.
|
|
36
|
+
|
|
37
|
+
- `spec validate` compiles every plan, so a typo in a step or `parse` option, an unknown
|
|
38
|
+
step or name, or a type mismatch fails validation rather than the run. Without
|
|
39
|
+
`--catalog`, problems in a tap column with no declared type are warnings. It takes
|
|
40
|
+
`--allow-python-udfs`, as `spec explain` does.
|
|
41
|
+
|
|
42
|
+
- A problem with a `parse` option is reported at `columns.<c>.parse.<key>`, not under
|
|
43
|
+
`transform`.
|
|
44
|
+
|
|
45
|
+
- `map-conform functions` reported no step as vectorised. It now lists the engines that
|
|
46
|
+
vectorise each step and cast (`engines`, `cast_engines` in `--json`), from the kernel
|
|
47
|
+
tables themselves.
|
|
48
|
+
|
|
8
49
|
## [0.1.0] - 2026-11-23
|
|
9
50
|
|
|
10
51
|
The first release: a Singer/Meltano inline mapper that conforms names, types, values and
|
|
@@ -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,201 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: map-conform
|
|
3
|
+
Version: 0.2.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.
|
|
67
|
+
|
|
68
|
+
## Why
|
|
69
|
+
|
|
70
|
+
Every Singer target cleans data a little differently, so the same CSV lands with different
|
|
71
|
+
values depending on where it goes, and BATCH data skips the SDK's per-record cleanup
|
|
72
|
+
altogether. The common fallback, a cleanup layer in dbt, is SQL only, needs macros that work
|
|
73
|
+
across every warehouse a project uses, and runs after the raw data, mess and personal data
|
|
74
|
+
included, has landed. map-conform does the cleanup once, in Python, before anything is
|
|
75
|
+
stored: exact decimals, real date parsing, Unicode-aware names and masking, for every target.
|
|
76
|
+
|
|
77
|
+
Compared with meltano-map-transformer (SDK stream maps), which renames, filters and computes
|
|
78
|
+
columns but takes types from expression prefixes and crashes on a bad value, map-conform
|
|
79
|
+
declares each column's type, cleans and casts the value, handles bad values by policy, and
|
|
80
|
+
conforms BATCH messages. Stream maps keep working ([migration](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md#moving-from-sdk-stream-maps)).
|
|
81
|
+
|
|
82
|
+
## Install
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pip install map-conform # the mapper
|
|
86
|
+
pip install 'map-conform[faker]' # + fake data for masking
|
|
87
|
+
pip install 'map-conform[polars]' # + the polars engine (regex, strptime formats)
|
|
88
|
+
pip install 'map-conform[s3]' # + BATCH files on S3
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Python 3.11 to 3.14.
|
|
92
|
+
|
|
93
|
+
## Use it in Meltano
|
|
94
|
+
|
|
95
|
+
map-conform is not on Meltano Hub yet, so add it as a custom mapper (`namespace` is what
|
|
96
|
+
makes it custom):
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
plugins:
|
|
100
|
+
mappers:
|
|
101
|
+
- name: map-conform
|
|
102
|
+
namespace: map_conform
|
|
103
|
+
pip_url: map-conform
|
|
104
|
+
executable: map-conform
|
|
105
|
+
mappings:
|
|
106
|
+
- name: conform
|
|
107
|
+
config:
|
|
108
|
+
spec_path: conform.yml
|
|
109
|
+
add_record_metadata: true # add the _sdc_* columns
|
|
110
|
+
loaders:
|
|
111
|
+
- name: target-postgres
|
|
112
|
+
config:
|
|
113
|
+
add_record_metadata: true # so the SDK target keeps them
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
meltano run tap-csv conform target-postgres
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Any setting can go in the mapping's `config`. To set them with `meltano config` or
|
|
121
|
+
environment variables, declare them under the plugin's `settings:` too;
|
|
122
|
+
[plugin-definition.yml](https://github.com/paulcaron16k/map-conform/blob/main/plugin-definition.yml)
|
|
123
|
+
lists every one, and `map-conform --about` describes them.
|
|
124
|
+
|
|
125
|
+
A spec (`conform.yml`) declares what the data should look like:
|
|
126
|
+
|
|
127
|
+
```yaml
|
|
128
|
+
version: 1
|
|
129
|
+
defaults:
|
|
130
|
+
on_error: reject # bad rows go to ./.map-conform/rejects, the run goes on
|
|
131
|
+
streams:
|
|
132
|
+
Orders Export:
|
|
133
|
+
key_properties: [order_id]
|
|
134
|
+
columns:
|
|
135
|
+
Order ID: {name: order_id, type: int64, nullable: false}
|
|
136
|
+
Amount ($): {type: "decimal(12,2)", parse: {parens_negative: true}}
|
|
137
|
+
Order Date: {type: date, parse: {formats: ["%m/%d/%Y", iso, excel_serial]}}
|
|
138
|
+
Customer Email: {transform: {hash: {salt: "${env:EMAIL_SALT}"}}}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`"$1,234.50"` lands as `1234.50`, `"(12.00)"` as `-12.00`, `"03/14/2026"` and `46095` as
|
|
142
|
+
`2026-03-14`, `Order ID` as `order_id` and `Amount ($)` as `amount`; the stream lands as
|
|
143
|
+
`orders_export` (`stream: {name: preserve}` keeps tap stream names). Columns the spec does
|
|
144
|
+
not mention are conformed from the tap's SCHEMA. Without a spec at all, map-conform conforms
|
|
145
|
+
names and types with its defaults.
|
|
146
|
+
|
|
147
|
+
Without `on_error`, a value that cannot be cast stops the run with the stream, column, row
|
|
148
|
+
and value: nothing lands wrong silently. Check a spec before running it with
|
|
149
|
+
`map-conform spec validate conform.yml`, and a project with `map-conform doctor`.
|
|
150
|
+
|
|
151
|
+
## Documentation
|
|
152
|
+
|
|
153
|
+
- [Cookbook](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md):
|
|
154
|
+
CSV, spreadsheet and European exports, bad values and rejects, epoch times, hashes and
|
|
155
|
+
fake names, masking, derived columns, parquet BATCH files, nested objects and declared
|
|
156
|
+
shapes, the `_sdc_*` columns, and moving from stream maps. Every example is run by the
|
|
157
|
+
test suite.
|
|
158
|
+
- [Spec reference](https://github.com/paulcaron16k/map-conform/blob/main/docs/spec-reference.md):
|
|
159
|
+
every setting, spec key, `parse` option, step and function, generated from the code.
|
|
160
|
+
- [Detailed design](https://github.com/paulcaron16k/map-conform/blob/main/docs/detailed-design.md): how each feature behaves, and why.
|
|
161
|
+
- [Clean-Landing Contract](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md): what a target may assume.
|
|
162
|
+
- The project's knowledge base is in [wiki/](https://github.com/paulcaron16k/map-conform/blob/main/wiki/index.md).
|
|
163
|
+
|
|
164
|
+
## Command line
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
map-conform --config config.json < tap-output.jsonl # the mapper (Singer SDK CLI)
|
|
168
|
+
map-conform spec validate conform.yml --catalog catalog.json
|
|
169
|
+
map-conform spec explain conform.yml --stream "Orders Export" --catalog catalog.json
|
|
170
|
+
map-conform spec import --catalog catalog.json > conform.yml # draft a spec
|
|
171
|
+
map-conform spec import --stream-maps config.json > conform.yml # from SDK stream maps
|
|
172
|
+
map-conform spec export conform.yml --zamboni table-config.json --catalog catalog.json
|
|
173
|
+
map-conform spec schema > conform.schema.json # for editor completion
|
|
174
|
+
map-conform doctor --meltano-yml meltano.yml
|
|
175
|
+
map-conform functions # steps, casts, functions
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
A catalog is what the tap discovers (`meltano invoke tap-csv --discover > catalog.json`);
|
|
179
|
+
with it, `spec validate` and `spec explain` check the spec against the tap's real columns
|
|
180
|
+
and types. `spec export --zamboni` writes each column's type into a
|
|
181
|
+
[Zamboni](https://github.com/paulcaron16k/Zamboni) table-config, the layout and
|
|
182
|
+
maintenance spec of its Iceberg tables; skip it if you do not use Zamboni.
|
|
183
|
+
|
|
184
|
+
## Development
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
uv sync --all-groups
|
|
188
|
+
uv run pytest
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
[CONTRIBUTING.md](https://github.com/paulcaron16k/map-conform/blob/main/CONTRIBUTING.md) has
|
|
192
|
+
the workflow, and the
|
|
193
|
+
[dev environment runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/dev-environment.md)
|
|
194
|
+
the checks that make a change done, the generated files, and checklists for adding a step,
|
|
195
|
+
an option, a setting or a type. Releases follow the
|
|
196
|
+
[release runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/release.md).
|
|
197
|
+
Security problems: [SECURITY.md](https://github.com/paulcaron16k/map-conform/blob/main/SECURITY.md).
|
|
198
|
+
|
|
199
|
+
## Licence
|
|
200
|
+
|
|
201
|
+
Apache-2.0
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# map-conform
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/map-conform/)
|
|
4
|
+
[](https://pypi.org/project/map-conform/)
|
|
5
|
+
[](https://github.com/paulcaron16k/map-conform/actions/workflows/test.yml)
|
|
6
|
+
[](https://github.com/paulcaron16k/map-conform/blob/main/LICENSE)
|
|
7
|
+
[](https://github.com/astral-sh/ruff)
|
|
8
|
+
|
|
9
|
+
A Singer/Meltano **inline mapper** that makes data *land clean*. It sits between any tap and
|
|
10
|
+
any target and, once, upstream:
|
|
11
|
+
|
|
12
|
+
- **casts to declared types**, never guessed: exact decimals, dates, timestamps in UTC,
|
|
13
|
+
booleans, UUIDs, JSON, structs and lists;
|
|
14
|
+
- **cleans values on the way**: currency symbols, thousands separators (US, European and
|
|
15
|
+
Swiss), accounting negatives, percentages, null tokens (`N/A`, `#N/A`, `-`), spreadsheet
|
|
16
|
+
serial dates, epoch times, time zones and DST, yes/no words;
|
|
17
|
+
- **conforms names** of streams, columns and nested members so every target accepts them:
|
|
18
|
+
snake_case, ASCII, length limits, reserved words, collision checks;
|
|
19
|
+
- **masks personal data**: hashes, keyed tokens, partial masks, redacted dates, fake values,
|
|
20
|
+
nulls, with conditions and nested paths;
|
|
21
|
+
- **computes columns and filters rows** with a safe expression language, macros and UDFs;
|
|
22
|
+
- **sets bad values aside** instead of crashing, if you ask: null them, keep them, or reject
|
|
23
|
+
the row to a file you can replay;
|
|
24
|
+
- **conforms BATCH files** (parquet or JSONL), with Arrow kernels for parquet and optionally
|
|
25
|
+
polars;
|
|
26
|
+
- **adds the `_sdc_*` metadata columns** with Singer SDK semantics, when asked;
|
|
27
|
+
- **accepts SDK `stream_maps` settings unchanged**, so meltano-map-transformer projects move
|
|
28
|
+
over without changes.
|
|
29
|
+
|
|
30
|
+
Targets can then rely on the [Clean-Landing Contract](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md):
|
|
31
|
+
what every record, SCHEMA and BATCH file from map-conform guarantees, so a target writes data
|
|
32
|
+
instead of cleaning it.
|
|
33
|
+
|
|
34
|
+
## Why
|
|
35
|
+
|
|
36
|
+
Every Singer target cleans data a little differently, so the same CSV lands with different
|
|
37
|
+
values depending on where it goes, and BATCH data skips the SDK's per-record cleanup
|
|
38
|
+
altogether. The common fallback, a cleanup layer in dbt, is SQL only, needs macros that work
|
|
39
|
+
across every warehouse a project uses, and runs after the raw data, mess and personal data
|
|
40
|
+
included, has landed. map-conform does the cleanup once, in Python, before anything is
|
|
41
|
+
stored: exact decimals, real date parsing, Unicode-aware names and masking, for every target.
|
|
42
|
+
|
|
43
|
+
Compared with meltano-map-transformer (SDK stream maps), which renames, filters and computes
|
|
44
|
+
columns but takes types from expression prefixes and crashes on a bad value, map-conform
|
|
45
|
+
declares each column's type, cleans and casts the value, handles bad values by policy, and
|
|
46
|
+
conforms BATCH messages. Stream maps keep working ([migration](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md#moving-from-sdk-stream-maps)).
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install map-conform # the mapper
|
|
52
|
+
pip install 'map-conform[faker]' # + fake data for masking
|
|
53
|
+
pip install 'map-conform[polars]' # + the polars engine (regex, strptime formats)
|
|
54
|
+
pip install 'map-conform[s3]' # + BATCH files on S3
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Python 3.11 to 3.14.
|
|
58
|
+
|
|
59
|
+
## Use it in Meltano
|
|
60
|
+
|
|
61
|
+
map-conform is not on Meltano Hub yet, so add it as a custom mapper (`namespace` is what
|
|
62
|
+
makes it custom):
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
plugins:
|
|
66
|
+
mappers:
|
|
67
|
+
- name: map-conform
|
|
68
|
+
namespace: map_conform
|
|
69
|
+
pip_url: map-conform
|
|
70
|
+
executable: map-conform
|
|
71
|
+
mappings:
|
|
72
|
+
- name: conform
|
|
73
|
+
config:
|
|
74
|
+
spec_path: conform.yml
|
|
75
|
+
add_record_metadata: true # add the _sdc_* columns
|
|
76
|
+
loaders:
|
|
77
|
+
- name: target-postgres
|
|
78
|
+
config:
|
|
79
|
+
add_record_metadata: true # so the SDK target keeps them
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
meltano run tap-csv conform target-postgres
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Any setting can go in the mapping's `config`. To set them with `meltano config` or
|
|
87
|
+
environment variables, declare them under the plugin's `settings:` too;
|
|
88
|
+
[plugin-definition.yml](https://github.com/paulcaron16k/map-conform/blob/main/plugin-definition.yml)
|
|
89
|
+
lists every one, and `map-conform --about` describes them.
|
|
90
|
+
|
|
91
|
+
A spec (`conform.yml`) declares what the data should look like:
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
version: 1
|
|
95
|
+
defaults:
|
|
96
|
+
on_error: reject # bad rows go to ./.map-conform/rejects, the run goes on
|
|
97
|
+
streams:
|
|
98
|
+
Orders Export:
|
|
99
|
+
key_properties: [order_id]
|
|
100
|
+
columns:
|
|
101
|
+
Order ID: {name: order_id, type: int64, nullable: false}
|
|
102
|
+
Amount ($): {type: "decimal(12,2)", parse: {parens_negative: true}}
|
|
103
|
+
Order Date: {type: date, parse: {formats: ["%m/%d/%Y", iso, excel_serial]}}
|
|
104
|
+
Customer Email: {transform: {hash: {salt: "${env:EMAIL_SALT}"}}}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`"$1,234.50"` lands as `1234.50`, `"(12.00)"` as `-12.00`, `"03/14/2026"` and `46095` as
|
|
108
|
+
`2026-03-14`, `Order ID` as `order_id` and `Amount ($)` as `amount`; the stream lands as
|
|
109
|
+
`orders_export` (`stream: {name: preserve}` keeps tap stream names). Columns the spec does
|
|
110
|
+
not mention are conformed from the tap's SCHEMA. Without a spec at all, map-conform conforms
|
|
111
|
+
names and types with its defaults.
|
|
112
|
+
|
|
113
|
+
Without `on_error`, a value that cannot be cast stops the run with the stream, column, row
|
|
114
|
+
and value: nothing lands wrong silently. Check a spec before running it with
|
|
115
|
+
`map-conform spec validate conform.yml`, and a project with `map-conform doctor`.
|
|
116
|
+
|
|
117
|
+
## Documentation
|
|
118
|
+
|
|
119
|
+
- [Cookbook](https://github.com/paulcaron16k/map-conform/blob/main/docs/cookbook.md):
|
|
120
|
+
CSV, spreadsheet and European exports, bad values and rejects, epoch times, hashes and
|
|
121
|
+
fake names, masking, derived columns, parquet BATCH files, nested objects and declared
|
|
122
|
+
shapes, the `_sdc_*` columns, and moving from stream maps. Every example is run by the
|
|
123
|
+
test suite.
|
|
124
|
+
- [Spec reference](https://github.com/paulcaron16k/map-conform/blob/main/docs/spec-reference.md):
|
|
125
|
+
every setting, spec key, `parse` option, step and function, generated from the code.
|
|
126
|
+
- [Detailed design](https://github.com/paulcaron16k/map-conform/blob/main/docs/detailed-design.md): how each feature behaves, and why.
|
|
127
|
+
- [Clean-Landing Contract](https://github.com/paulcaron16k/map-conform/blob/main/wiki/concepts/clean-landing-contract.md): what a target may assume.
|
|
128
|
+
- The project's knowledge base is in [wiki/](https://github.com/paulcaron16k/map-conform/blob/main/wiki/index.md).
|
|
129
|
+
|
|
130
|
+
## Command line
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
map-conform --config config.json < tap-output.jsonl # the mapper (Singer SDK CLI)
|
|
134
|
+
map-conform spec validate conform.yml --catalog catalog.json
|
|
135
|
+
map-conform spec explain conform.yml --stream "Orders Export" --catalog catalog.json
|
|
136
|
+
map-conform spec import --catalog catalog.json > conform.yml # draft a spec
|
|
137
|
+
map-conform spec import --stream-maps config.json > conform.yml # from SDK stream maps
|
|
138
|
+
map-conform spec export conform.yml --zamboni table-config.json --catalog catalog.json
|
|
139
|
+
map-conform spec schema > conform.schema.json # for editor completion
|
|
140
|
+
map-conform doctor --meltano-yml meltano.yml
|
|
141
|
+
map-conform functions # steps, casts, functions
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
A catalog is what the tap discovers (`meltano invoke tap-csv --discover > catalog.json`);
|
|
145
|
+
with it, `spec validate` and `spec explain` check the spec against the tap's real columns
|
|
146
|
+
and types. `spec export --zamboni` writes each column's type into a
|
|
147
|
+
[Zamboni](https://github.com/paulcaron16k/Zamboni) table-config, the layout and
|
|
148
|
+
maintenance spec of its Iceberg tables; skip it if you do not use Zamboni.
|
|
149
|
+
|
|
150
|
+
## Development
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
uv sync --all-groups
|
|
154
|
+
uv run pytest
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
[CONTRIBUTING.md](https://github.com/paulcaron16k/map-conform/blob/main/CONTRIBUTING.md) has
|
|
158
|
+
the workflow, and the
|
|
159
|
+
[dev environment runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/dev-environment.md)
|
|
160
|
+
the checks that make a change done, the generated files, and checklists for adding a step,
|
|
161
|
+
an option, a setting or a type. Releases follow the
|
|
162
|
+
[release runbook](https://github.com/paulcaron16k/map-conform/blob/main/wiki/runbooks/release.md).
|
|
163
|
+
Security problems: [SECURITY.md](https://github.com/paulcaron16k/map-conform/blob/main/SECURITY.md).
|
|
164
|
+
|
|
165
|
+
## Licence
|
|
166
|
+
|
|
167
|
+
Apache-2.0
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report security problems privately, not in a public issue: on GitHub, open the
|
|
6
|
+
repository's **Security** tab and choose **Report a vulnerability**. Include the version, a
|
|
7
|
+
spec or input that shows the problem, and its impact. You will get an answer within a week,
|
|
8
|
+
and a fix or a plan with a timeline once the report is confirmed. Credit is given in the
|
|
9
|
+
release notes unless you prefer otherwise.
|
|
10
|
+
|
|
11
|
+
## Supported versions
|
|
12
|
+
|
|
13
|
+
Fixes go into the latest release. Before 1.0 there is one supported line: the newest
|
|
14
|
+
`0.x` version on PyPI.
|
|
15
|
+
|
|
16
|
+
## What is in scope
|
|
17
|
+
|
|
18
|
+
map-conform runs inside data pipelines, often with access to credentials and personal data.
|
|
19
|
+
These are vulnerabilities:
|
|
20
|
+
|
|
21
|
+
- **Escaping the expression sandbox.** Spec expressions (`expr`, `when`, `filter`, `case`)
|
|
22
|
+
run in a restricted evaluator (`map_conform/expr/sandbox.py`): no imports, no attribute
|
|
23
|
+
access outside an allowed list, no private names, bounded sizes. Any way for a spec to run
|
|
24
|
+
arbitrary code, read files or the environment, or exhaust memory or time beyond those
|
|
25
|
+
bounds through an expression is in scope.
|
|
26
|
+
- **Bypassing the UDF opt-in.** Python functions named by module path in a spec run only with
|
|
27
|
+
`allow_python_udfs: true`. Any way for a spec to import or run Python without it is in
|
|
28
|
+
scope.
|
|
29
|
+
- **Leaking secrets or personal data.** Salts, token keys or masked values appearing in
|
|
30
|
+
logs, error messages, metrics or output where the spec masks them; a masking step that
|
|
31
|
+
fails open.
|
|
32
|
+
- **Writing outside the configured locations** for BATCH output or rejects.
|
|
33
|
+
|
|
34
|
+
## What is not
|
|
35
|
+
|
|
36
|
+
- **UDFs and installed plugins** are trusted Python code by design: a UDF the spec enables,
|
|
37
|
+
or a package that registers `map_conform.functions` entry points, can do anything Python
|
|
38
|
+
can.
|
|
39
|
+
- **Whoever controls the spec** controls the pipeline's transformations; treat a spec like
|
|
40
|
+
code and review it.
|
|
41
|
+
- The strength of `hash` without a salt, or of `mask`, against guessing: choose `tokenize`
|
|
42
|
+
with a secret key, or a salted hash, for values that can be enumerated.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# The conform spec of the development project in meltano.yml (a test loads it).
|
|
2
|
+
# Every key: docs/spec-reference.md; editor schema: map_conform/map-conform-spec.schema.json
|
|
3
|
+
version: 1
|
|
4
|
+
defaults:
|
|
5
|
+
on_error: raise
|
|
6
|
+
streams:
|
|
7
|
+
animals:
|
|
8
|
+
columns:
|
|
9
|
+
id: {type: int64, nullable: false}
|