rheinwerk-verlag / pganonymize

A commandline tool for anonymizing PostgreSQL databases
http://pganonymize.readthedocs.io/
Other
42 stars 26 forks source link

Script fails to run #29

Closed meswanb closed 3 years ago

meswanb commented 3 years ago

Version: pganonymize-0.5.0

INFO: Found table definition "users"
Anonymizing |████████████████████████████████| 5656/5656
Traceback (most recent call last):
  File "/usr/local/bin/pganonymize", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/pganonymizer/__main__.py", line 10, in main
    main()
  File "/usr/local/lib/python3.8/dist-packages/pganonymizer/cli.py", line 71, in main
    anonymize_tables(connection, schema.get('tables', []), verbose=args.verbose)
  File "/usr/local/lib/python3.8/dist-packages/pganonymizer/utils.py", line 43, in anonymize_tables
    import_data(connection, column_dict, table_name, table_columns, primary_key, data)
  File "/usr/local/lib/python3.8/dist-packages/pganonymizer/utils.py", line 154, in import_data
    copy_from(connection, data, temp_table, table_columns)
  File "/usr/local/lib/python3.8/dist-packages/pganonymizer/utils.py", line 132, in copy_from
    cursor.copy_from(new_data, table, sep=COPY_DB_DELIMITER, null='\\N', columns=quoted_cols)
psycopg2.errors.UndefinedColumn: column ""id"" of relation "tmp_users" does not exist

@hkage

nurikk commented 3 years ago

Hi, @meswanb Can you try to use pganonymize 0.6.0?

meswanb commented 3 years ago

@nurikk , worked like a charm. Thanks!

hkage commented 3 years ago

Thanks for answering @nurikk I will close the issue.

hkage commented 3 years ago

One questtion @meswanb Did you use a checkout of the repository or the version from PyPi? Unfortunately after releasing version 0.6.0 I realized, that the setup.py is missing all the new requirements like parmap, tqdm and pgcopy. So currently the version from PyPi shouldn't work - in contrast to a virtualenv created with poetry.

I will update the setup.py and create a bugfix release with the correct install_requires entries.

meswanb commented 3 years ago

I grabbed it from PyPi and locally installed parmap, tqdm and pgcopy.

hkage commented 3 years ago

Ok, thanks for your answer. The requirements should be installed automatically after installing the anonymizer with pip install. I will fix that with the next release.