meltano: Bug: several empty keys are added when the last top-level key is removed via the CLI

IN https://github.com/meltano/meltano/pull/6308 I found that if you have an additional meltano.yml file like so:

# schedules.meltano.yml
schedules:
- name: run_github_commits
  interval: '@daily'
  job: github_data

If you remove that schedule via the CLI that file will look like:

# schedules.meltano.yml
plugins: {}
schedules: []
jobs: []
environments: []

This isn’t ideal because the diff can be confusing. Functionally it’s fine, but I’d expect either the final file to either be schedules: [] or just blank.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

@aaronsteers yes, this is low priority and in the product backlog.

  • Does this happen for all files where the final key is removed? So, if we only have one meltano.yml file (with no project_id or other top level keys), do we still get the other top-level keys appearing when the last schedule is removed?
  • Does this happen for other top-level keys? For instance, if I only have environments and I remove them all in the CLI, do the other keys “pop in” once the last top-level key is removed?

@aaronsteers this only happens in included files when all top-level shared keys (environments, schedules, jobs, plugins) are left empty after an operation.