Skip to content

Add yaml_to_json transformer to basic transformer plugin#22454

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/add-yaml-to-json-transformer
Draft

Add yaml_to_json transformer to basic transformer plugin#22454
Copilot wants to merge 2 commits into
mainfrom
copilot/add-yaml-to-json-transformer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Adds a yaml_to_json transformation kind that converts string columns containing YAML into JSON-typed columns. Primary use case: converting the content field from the git source plugin's git_files table to enable JSON-based querying at the destination.

Changes

  • spec.go — New KindYAMLToJSON constant with validation (requires columns, rejects name/value/new_table_name_template)
  • schema_updater.goChangeColumnTypes() method to retype columns in Arrow schemas
  • record_updater.goYAMLToJSON() method: parses YAML string values via ghodss/yaml, emits JSON-typed Arrow arrays
  • transformers.go — Wires up the new kind in NewFromSpec()
  • go.mod — Promotes ghodss/yaml from indirect to direct dependency (no new deps added)

Example config

transformations:
  - kind: yaml_to_json
    columns: ["content"]
    tables: ["git_files"]

Non-YAML-parseable values will error rather than silently pass through. Null values are preserved as null.

Adds a new transformation kind that converts string columns containing
YAML content into JSON-typed columns. This is useful for converting
YAML file content (e.g., from git_files table) to JSON format to
enable JSON-based querying in destinations.

Agent-Logs-Url: https://github.com/cloudquery/cloudquery/sessions/18f43047-fe5a-4bac-b632-d392287ee2d3

Co-authored-by: murarustefaan <15239186+murarustefaan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add transformer to convert string-like field from yaml to json Add yaml_to_json transformer to basic transformer plugin Apr 1, 2026
Copilot AI requested a review from murarustefaan April 1, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants