csv2notion-neo icon indicating copy to clipboard operation
csv2notion-neo copied to clipboard

[Bug]: Fails to import first column for first 5 rows of the CSV file

Open bumper314 opened this issue 1 year ago • 1 comments

CSV2Notion Neo Version?

1.3.1

What OS are you using?

MacOS

OS Version or Linux distribution

macOS 10.14

Bug Description

I have a well formed CSV file where the first column is a unique id for each row. Using csv2notion_neo (or csv2notion) to create a new database fails to import this data correctly, somehow skipping the first column and using the second column for the first 5 rows of the CSV (not including the header). It doesn't matter if I change the content of the CSV, it's always the first 5 rows that get borked.

Screen Shot 2024-09-20 at 21 19 45

Here's the sample data: youtube2csv_espanolconjuan.csv

I'm running csv2notion_neo --verbose --workspace "Workspace" --token "$token" "youtube2csv_espanolconjuan.csv" to create a new database.

However, if I delete the bad data, add --merge, and run again, the content gets imported correctly the second time.

Log excerpt

INFO: CSV2Notion Neo version 1.3.1
INFO: Validating csv & csv2notion_neo.notion DB schema
INFO: Creating new database
INFO: New database URL: https://www.notion.so/XXXXXXXXX
INFO: Uploading youtube2csv_espanolconjuan.csv...
INFO: Done!

bumper314 avatar Sep 21 '24 03:09 bumper314

Thanks for letting us know! Will look into it

arjunprakash027 avatar Sep 28 '24 19:09 arjunprakash027

@bumper314 - The problem is with names of the column. Notion names the ID column as "Title"/"title" , and therefore according to notion Slug is your "Title" column. And then there is another column named "Title" in your csv, and therefore this problem occurs. Note this happens only while creating a new database and not using a created one.

Quick fix is to change Title to something else like Vedio Title.

I am finding a solution to it programatically

arjunprakash027 avatar Nov 04 '24 03:11 arjunprakash027

Fixed the code too. Please have a try and let us know

arjunprakash027 avatar Nov 04 '24 03:11 arjunprakash027

@arjunprakash027

I am getting this error from latest build.

ERROR: Got 400 error attempting to POST to loadPageChunk, with data: {
  "pageId": "000000......",
  "limit": 100,
  "cursor": {
    "stack": []
  },
  "chunkNumber": 0,
  "verticalColumns": false
}
ERROR: Error at division
Traceback (most recent call last):
  File "csv2notion_neo/cli.py", line 51, in cli
  File "csv2notion_neo/notion_db.py", line 119, in get_collection_id
  File "csv2notion_neo/notion/client.py", line 195, in get_block
  File "csv2notion_neo/notion/client.py", line 188, in get_record_data
  File "csv2notion_neo/notion/store.py", line 184, in get
  File "csv2notion_neo/notion/store.py", line 289, in call_load_page_chunk
  File "csv2notion_neo/notion/client.py", line 287, in post
requests.exceptions.HTTPError: Something went wrong. (400)

IAmVigneswaran avatar Nov 04 '24 12:11 IAmVigneswaran

@IAmVigneswaran - Its fixed now!

arjunprakash027 avatar Nov 04 '24 16:11 arjunprakash027

@bumper314 This bug should now be fixed.

IAmVigneswaran avatar Nov 05 '24 02:11 IAmVigneswaran

@IAmVigneswaran Excellent! I did a few tests and it seems to work as expect, thank you.

bumper314 avatar Nov 05 '24 03:11 bumper314

@IAmVigneswaran Excellent! I did a few tests and it seems to work as expect, thank you.

Thanks for the conformation.

Once this #41 is addressed, we will release 1.3.2 shortly.

IAmVigneswaran avatar Nov 05 '24 03:11 IAmVigneswaran

@bumper314 1.3.2 is now live.

IAmVigneswaran avatar Nov 05 '24 06:11 IAmVigneswaran