z3z1ma / dbt-osmosis

Provides automated YAML management, a dbt server, streamlit workbench, and git-integrated dbt model output diff tools
https://z3z1ma.github.io/dbt-osmosis/
Apache License 2.0
478 stars 47 forks source link

[fix] extra newlines #5

Closed hbwhbw closed 2 years ago

hbwhbw commented 2 years ago

Maybe just on Windows: yml files with comments "#" in the original file end up getting an extry newline after each comment. For example, typically people comment out tests like this:

  - name: my_column
    description: exactly what you want it to mean
      #        tests:
      #          - not_null

  - name: next_column

But this comes out the other side of a dbt-osmosis run as:

  - name: my_column
    description: exactly what you want it to mean
      #        tests:

      #          - not_null

  - name: next_column

Note that this is pretty horrible because if you run it multiple times, then each run that changes the file will introduce a new blank line for every comment and the file will just explode.

z3z1ma commented 2 years ago

This is not happening for me and I cant recreate. Lets re-open if more people experience this issue otherwise it might be isolated to a conflicting ruamel yaml installation or older version.