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

`fields_hidden_by_default: yes` is removed #70

Open Jacky56 opened 1 year ago

Jacky56 commented 1 year ago

Hello all,

Upon performing lookml.File("file_path").write() it will remove some key values such as fields_hidden_by_default: yes on version 3.0.3

To recreate:

the file:

view: view_name {
  fields_hidden_by_default: yes

  dimension: pk {
    description: "some pk"
    type: string
    primary_key: yes
    sql: ${TABLE}."pk" ;;
  }

  dimension: name_of_cats {
    description: "names of cats"
    type: string
    sql: ${TABLE}."name_of_cats" ;;
  }
}

the code:

import lookml

file_path = "path/to/yaml.view.lookml"
view_file = lookml.File(file_path)
view_file.write()
Jacky56 commented 1 year ago

On looking deeper,

performing:

import lookml

file_path = "path/to/yaml.view.lookml"
view_file = lookml.File(file_path)
print(str(view_file))

doesn't seem to capture fields_hidden_by_default: yes once read