annotaterb icon indicating copy to clipboard operation
annotaterb copied to clipboard

Bug (apparently): :ignore_columns does not work (with any syntax I've tried)

Open brandonzylstra opened this issue 1 year ago • 0 comments

I've tried to ignore several columns, and have not had any success with any syntax that seems plausible. Since there are other settings that have (empty) arrays, it seemed like these might be expected on a single line as an array, so tried using square brackets with the fields inside, but I also tried without the square brackets. I tried naming the fields with bare words, single- and double-quoted names, and symbol syntax. None of that worked. I also tried putting the fields on subsequent lines using normal YAML syntax. None of that worked either.

There is nothing I see that serves as an example.

Permutations Attempted

:ignore_columns: [:created_at, :updated_at]
:ignore_columns: ['created_at', 'updated_at']
:ignore_columns: ["created_at", "updated_at"]
:ignore_columns: [created_at, updated_at]
:ignore_columns: :created_at, :updated_at
:ignore_columns: 'created_at', 'updated_at'
:ignore_columns: "created_at", "updated_at"
:ignore_columns: created_at, updated_at
:ignore_columns:
- :created_at
- :updated_at
:ignore_columns:
- 'created_at'
- 'updated_at'
:ignore_columns:
- "created_at"
- "updated_at"
:ignore_columns:
- created_at
- updated_at

The first one results in

bundler: failed to load command: annotaterb (/Users/brandon/.rbenv/versions/3.3.5/bin/annotaterb)
/Users/brandon/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/psych-3.3.4/lib/psych.rb:457:in `parse': (/Users/brandon/Code/Rails/portal/.annotaterb.yml): did not find expected node content while parsing a flow node at line 43 column 19 (Psych::SyntaxError)

The second, third, fourth, ninth, tenth, eleventh, and twelfth permutations all result in

bundler: failed to load command: annotaterb (/Users/brandon/.rbenv/versions/3.3.5/bin/annotaterb)
/Users/brandon/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/annotaterb-4.12.0/lib/annotate_rb/model_annotator/model_wrapper.rb:103:in `max_schema_info_width': undefined method `+' for nil (NoMethodError)

            max_size += @options[:format_rdoc] ? 5 : 1

The fifth and eigth permutations don't give any errors, but fail to filter out the specified columns.

The sixth and seventh permutations showed YAML errors in my editors, and result in

bundler: failed to load command: annotaterb (/Users/brandon/.rbenv/versions/3.3.5/bin/annotaterb)
/Users/brandon/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/psych-3.3.4/lib/psych.rb:457:in `parse': (/Users/brandon/Code/Rails/portal/.annotaterb.yml): did not find expected key while parsing a block mapping at line 2 column 1 (Psych::SyntaxError)

Unless I'm failing to see a possibility, it appears that filtering columns is not working.

Versions

  • annotaterb (4.12.0)
  • Rails 7.1.4
  • ruby 3.3.5 (2024-09-03 revision ef084cc8f4) [arm64-darwin23]
  • Postgres 14.0
  • pg (1.5.8)

brandonzylstra avatar Sep 17 '24 18:09 brandonzylstra