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 20250101 and 20241201 Dump release company has companies with null id causing import to fail #153

Open
ijabz opened this issue Jan 24, 2025 · 1 comment

Comments

@ijabz
Copy link
Collaborator

ijabz commented Jan 24, 2025

e.g

`release_company, line 13552: "3759,,Infinite Jazz Recordings,14,Copyright (c),"

causes



`Importing data from /home/ubuntu/code/discogs-xml2db/csv-dir/release_company.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 "company_id" violates not-null constraint
DETAIL:  Failing row contains (13551, 3759, null, Infinite Jazz Recordings, 14, Copyright (c), null).
CONTEXT:  COPY release_company, line 13552: "3759,,Infinite Jazz Recordings,14,Copyright (c),"
@ijabz
Copy link
Collaborator Author

ijabz commented Jan 24, 2025

Remove with

grep -E "^[0-9]+,," -v release_company.csv > release_company.tmp; rm release_company.csv; mv release_company.tmp release_company.csv

@ijabz ijabz changed the title In 20250101 release country has countries with null id causing import to fail In 20250101 release company has companies with null id causing import to fail Jan 26, 2025
@ijabz ijabz changed the title In 20250101 release company has companies with null id causing import to fail In 20250101 and 20241201 Dump release company has companies with null id causing import to fail 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