Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In 202050101 and 20251201 Dump Import of Master Artist Failing #151

Open
ijabz opened this issue Jan 24, 2025 · 3 comments
Open

In 202050101 and 20251201 Dump Import of Master Artist Failing #151

ijabz opened this issue Jan 24, 2025 · 3 comments

Comments

@ijabz
Copy link
Collaborator

ijabz commented Jan 24, 2025

Failing with

Importing data from /home/ubuntu/code/discogs-xml2db/csv-dir/master_artist.csv
Traceback (most recent call last):
  File "postgresql/importcsv.py", line 42, in <module>
    load_csv(os.path.abspath(filename), db)
  File "postgresql/importcsv.py", line 33, in load_csv
    cursor.copy_expert(q, fp)
psycopg2.errors.NotNullViolation: null value in column "artist_id" violates not-null constraint
DETAIL:  Failing row contains (38233, 35849, null, Hecate, null, 1, null, null).
CONTEXT:  COPY master_artist, line 38234: "35849,,Hecate,,1,,"

Problem line in master_artist.csv is
35849,,Hecate,,1,,

@ijabz ijabz changed the title In 202050101 Import of Masdter Artist Failing In 202050101 Import of Master Artist Failing Jan 24, 2025
@ijabz
Copy link
Collaborator Author

ijabz commented Jan 24, 2025

and
`
52196,,Rude Poets,,1,,"

@ijabz
Copy link
Collaborator Author

ijabz commented Jan 24, 2025

grep -G "^[0-9]*,," master_artist.csv

shows all the problem lines, not clear why we are now getting these.

@ijabz
Copy link
Collaborator Author

ijabz commented Jan 24, 2025

Use grep -G "^[0-9]*,," -v master_artist.csv > master_artist.csv2``

to create a version of file with problem lines removed
`

@ijabz ijabz changed the title In 202050101 Import of Master Artist Failing In 202050101 and 20251201 Import of Master Artist Failing Jan 26, 2025
@ijabz ijabz changed the title In 202050101 and 20251201 Import of Master Artist Failing In 202050101 and 20251201 Dump Import of Master Artist Failing Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant