{
  "name": "csv-validate",
  "title": "Validate a CSV's headers and row count",
  "category": "Data",
  "tags": [
    "data",
    "python"
  ],
  "version": "1.0.1",
  "date": "2026-08-18",
  "notes": "Repin python:3.13-slim on the current digest. Same tag, CPython 3.13.14 to 3.13.15, and Entrypoint, Cmd, User and WorkingDir are identical on both. The repin clears nothing: util-linux CVE-2026-53615 is on the new bytes too. What it buys is a record that holds, because an OS baseline covers a pin only while that pin is its tag's head, and this one had fallen behind. pip also moves 26.1.2 to 26.2.1, which ships an SBOM of its vendored tree, so trivy now reports the msgpack and setuptools the old pin already vendored without declaring; both are recorded in hack/image-cve-exceptions.txt. This item runs python -c over the stdlib and never invokes pip.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/csv-validate/1.0.1.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/csv-validate/1.0.1/template.yaml",
  "entrypoint": "validate",
  "parameters": [
    {
      "name": "csv-content",
      "title": "CSV content",
      "description": "The CSV document to validate, as a string (header row required).",
      "type": "string",
      "required": true
    },
    {
      "name": "min-rows",
      "title": "Minimum rows",
      "description": "Minimum number of data rows the CSV must contain (0 = no minimum).",
      "type": "string",
      "required": false,
      "default": "0"
    },
    {
      "name": "required-columns",
      "title": "Required columns",
      "description": "Comma-separated list of column names that must be present in the header.",
      "type": "string",
      "required": false,
      "default": "",
      "example": "id,email,created_at"
    }
  ],
  "images": [
    {
      "ref": "python@sha256:94d3426f1def7db4a106a232ac121bfd975393e5dfd40a619b955fae45fe7913",
      "repository": "python",
      "tag": "3.15-slim",
      "digest": "sha256:94d3426f1def7db4a106a232ac121bfd975393e5dfd40a619b955fae45fe7913"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/csv-validate/1.0.1/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/csv-validate/1.0.1/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: csv-validate\n  labels:\n    dagweave.io/catalog-item: csv-validate\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.1\"\n    dagweave.io/catalog-category: \"Data\"\nspec:\n  entrypoint: validate\n  templates:\n    - name: validate\n      inputs:\n        parameters:\n          # The CSV document to validate, as a string (header row required).\n          - name: csv-content\n          # Comma-separated list of column names that must be present in the header.\n          - name: required-columns\n            default: \"\"\n          # Minimum number of data rows the CSV must contain (0 = no minimum).\n          - name: min-rows\n            default: \"0\"\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # python:3.15-slim\n        image: python@sha256:94d3426f1def7db4a106a232ac121bfd975393e5dfd40a619b955fae45fe7913\n        # The script is a static program; all user values arrive via env vars\n        # (read with os.environ), never interpolated into code or a shell.\n        command: [python, -c]\n        args:\n          - |\n            import csv, io, os, sys\n            content = os.environ[\"CSV_CONTENT\"]\n            required = [c.strip() for c in os.environ.get(\"REQUIRED_COLUMNS\", \"\").split(\",\") if c.strip()]\n            min_rows = int(os.environ.get(\"MIN_ROWS\", \"0\") or \"0\")\n            reader = csv.reader(io.StringIO(content))\n            try:\n                header = [h.strip() for h in next(reader)]\n            except StopIteration:\n                print(\"FAIL: CSV is empty (no header row)\", file=sys.stderr)\n                sys.exit(1)\n            missing = [c for c in required if c not in header]\n            if missing:\n                print(\"FAIL: missing required columns: \" + \", \".join(missing), file=sys.stderr)\n                sys.exit(1)\n            rows = sum(1 for _ in reader)\n            if rows \u003c min_rows:\n                print(\"FAIL: expected at least %d data rows, found %d\" % (min_rows, rows), file=sys.stderr)\n                sys.exit(1)\n            print(\"OK: %d columns, %d data rows; all %d required columns present\" % (len(header), rows, len(required)))\n        env:\n          - name: CSV_CONTENT\n            value: \"{{inputs.parameters.csv-content}}\"\n          - name: REQUIRED_COLUMNS\n            value: \"{{inputs.parameters.required-columns}}\"\n          - name: MIN_ROWS\n            value: \"{{inputs.parameters.min-rows}}\"\n",
  "templateSha256": "1a4bd25c39c105f6c1b4d8c46dce4a750eb8e234fbb9d6da2357222e7f93fb67",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/csv-validate",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
