vzhd1701 / csv2notion

Import/Merge CSV files into Notion database
MIT License
74 stars 10 forks source link

[Bug]: TypeError: unhashable type: 'list' #5

Closed latenitefilms closed 2 years ago

latenitefilms commented 2 years ago

csv2notion version

csv2notion 0.3.0

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 12.4

Bug description

Error when attempting to do:

./csv2notion --token "xxx" --image-column "Image Filename" --image-column-keep --mandatory-column "Shot ID" --image-caption-column "Scene Description" --max-threads 5 --merge --log ~/Desktop/uploadlog.txt --verbose test.csv
./csv2notion --token "xxx" --max-threads 5 --merge --log ~/Desktop/uploadlog.txt --verbose test.csv
./csv2notion --token "xxx" --log ~/Desktop/uploadlog.txt --verbose test.csv

CSV Data:

Shot ID,Shot Number,Scene Location,Shot Duration,Scene Number,Scene Prefix,Scene Time,Scene Time Range,Scene Set,Script Page No.,Scene Characters,Scene Cast,Scene Description,Shot Size & Type,Camera Movement,Camera Angle,Equipment,Lens,Lighting Notes,VFX,VFX Description,SFX,SFX Description,Music Track,Production Design,Props,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,Flag,User Notes 1,User Notes 2,Start Date,End Date,Days,Image Filename
001-1,1,Location Address,00:00:05,001,INT,Dawn,Scene Time Range,Set ID,1,Scene Characters,Scene Cast,Scene Description,WS,Camera Movement,Eye Line,Equipment,Focal length,Lighting Notes,false,VFX Description,false,SFX Description,Music Track,Production Design,Props ID,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,false,User Notes 1,User Notes 2,Start Date,End Date,Days,,
001-2,2,Location Address,00:00:05,001,INT,Dawn,Scene Time Range,Set ID,1,Scene Characters,Scene Cast,Scene Description,WS,Camera Movement,Eye Line,Equipment,Focal length,Lighting Notes,false,VFX Description,false,SFX Description,Music Track,Production Design,Props ID,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,false,User Notes 1,User Notes 2,Start Date,End Date,Days,,

Log excerpt

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14671] Failed to execute script '__main__' due to unhandled exception!

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14770] Failed to execute script '__main__' due to unhandled exception!

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14810] Failed to execute script '__main__' due to unhandled exception!
vzhd1701 commented 2 years ago

You have inconsistent number of columns in your CSV. I fixed the bug, it will give you warning now instead of crashing. Please check out the new version. Homebrew version will be updated in ~30 minutes.

latenitefilms commented 2 years ago

Legend, thanks!