looker-open-source / pylookml

A pythonic api for automatic lookml
https://pylookml.readthedocs.io/en/latest/introduction.html
MIT License
44 stars 22 forks source link

output new dimension isn't readable #35

Closed namusic closed 3 years ago

namusic commented 3 years ago

Output Format of new dimension made by addDimension method is incorrect indent

・Code

 view = lookml.VIew('pylookml')
 view.addDimension('id')
 view.id.sql = '${TABLE}.id'
 file = lookml.File('lookml_file')
 file.put(view)

・Expected Output

  dimension: id {
     type: string
     sql: ${TABLE}.id ;;
  }

・Result Output

    dimension: id {    type: string
    sql: ${TABLE}.id ;; }
russlooker commented 3 years ago

Thank you for the feedback! I implemented the fix and will be pushing it with the 2.0 release coming very soon

russlooker commented 3 years ago

The whitespace has been completely fixed in version 3.0.0, now available in pip try out the new version and let me know any thoughts