Closed arielb2 closed 10 years ago
True, I had forgotten. Thanks :) done.
corrected.
:+1: to merge! Thanks @arielb2.
I ran into problems with this when trying to run it in our staging environment:
$ FEDORATAGGER_CONFIG=/etc/fedoratagger/fedoratagger.cfg fedoratagger-merge-tag -b n
Finding duplicate values.....
Traceback (most recent call last):
File "/usr/bin/fedoratagger-merge-tag", line 9, in <module>
load_entry_point('fedora-tagger==2.1.4', 'console_scripts', 'fedoratagger-merge-tag')()
File "/usr/lib/python2.6/site-packages/fedoratagger/lib/merge_tags.py", line 95, in main
process_values()
File "/usr/lib/python2.6/site-packages/fedoratagger/lib/merge_tags.py", line 33, in process_values
having(func.count("*")>1).all()
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2237, in all
return list(self)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2349, in __iter__
return self._execute_and_instances(context)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/orm/query.py", line 2364, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 662, in execute
params)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 761, in _execute_clauseelement
compiled_sql, distilled_params
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 874, in _execute_context
context)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 1024, in _handle_dbapi_exception
exc_info
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/util/compat.py", line 195, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/base.py", line 867, in _execute_context
context)
File "/usr/lib64/python2.6/site-packages/SQLAlchemy-0.8.2-py2.6-linux-x86_64.egg/sqlalchemy/engine/default.py", line 324, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (ProgrammingError) column "tag.label" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ...(tag.id) AS id, tag.package_id AS tag_package_id, tag.label ...
^
'SELECT min(tag.id) AS id, tag.package_id AS tag_package_id, tag.label AS tag_label, sum(tag."like") AS "like", sum(tag.dislike) AS dislike \nFROM tag GROUP BY lower
(tag.label), tag.package_id \nHAVING count(%(param_1)s) > %(count_1)s' {'param_1': '*', 'count_1': 1}
This is a result of differences between postgres and sqlite.
Converted to lower-case and merging where tags duplicate.