cogs icon indicating copy to clipboard operation
cogs copied to clipboard

cogs add -> cogs rm fails

Open matentzn opened this issue 5 years ago • 2 comments

When doing cogs add followed by cogs rm without specifying freeze rows I get:

Traceback (most recent call last):
  File "/Users/matentzn/opt/anaconda3/bin/cogs", line 8, in <module>
    sys.exit(main())
  File "/Users/matentzn/opt/anaconda3/lib/python3.8/site-packages/cogs/cli.py", line 207, in main
    args.func(args)
  File "/Users/matentzn/opt/anaconda3/lib/python3.8/site-packages/cogs/rm.py", line 110, in run
    rm(args)
  File "/Users/matentzn/opt/anaconda3/lib/python3.8/site-packages/cogs/rm.py", line 56, in rm
    writer.writerow(sheet)
  File "/Users/matentzn/opt/anaconda3/lib/python3.8/csv.py", line 154, in writerow
    return self.writer.writerow(self._dict_to_list(rowdict))
  File "/Users/matentzn/opt/anaconda3/lib/python3.8/csv.py", line 149, in _dict_to_list
    raise ValueError("dict contains fields not in fieldnames: "
ValueError: dict contains fields not in fieldnames: 'Frozen Columns', 'Frozen Rows'

matentzn avatar Jan 14 '21 15:01 matentzn

full command trail, but not relevant for you probably.

I used the pypi version of cogs.

matentzn@mbp:~/ws/mondo-analysis (master) $ cogs add mondo_translate/mondo-omim-analysis.csv 
matentzn@mbp:~/ws/mondo-analysis (master) $ cogs add mondo_translate/mondo-doid-axiom-analysis.csv 
matentzn@mbp:~/ws/mondo-analysis (master) $ cogs add mondo_translate/mondo-omim-axiom-analysis.csv 
matentzn@mbp:~/ws/mondo-analysis (master) $ cogs rm mondo_translate/mondo-omim-analysis.csv 

matentzn avatar Jan 14 '21 15:01 matentzn

I think this is resolved by the current version on master. Here's what I ran:

$ cogs add test/test.tsv
$ cogs add test/test2.tsv
$ cogs add test/test3.tsv
$ cogs rm test/test.tsv

If you have a minute, can you confirm this works OK now?

beckyjackson avatar Mar 02 '21 17:03 beckyjackson