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

global: suppress warnings during app instantiation #1646

Closed
3 of 4 tasks
jacquerie opened this issue Oct 13, 2016 · 9 comments
Closed
3 of 4 tasks

global: suppress warnings during app instantiation #1646

jacquerie opened this issue Oct 13, 2016 · 9 comments

Comments

@jacquerie
Copy link
Contributor

jacquerie commented Oct 13, 2016

Currently inspirehep shell prints the following output when DEBUG=True:

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.cache is deprecated, use flask_cache instead.
  .format(x=modname), ExtDeprecationWarning

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/sqlalchemy/ext/declarative/clsregistry.py:120: SAWarning: This declarative base already contains a class with the same class name and module name as flask_sqlalchemy.RecordMetadataVersion, and will be replaced in the string-lookup table.
  item.__name__

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/sqlalchemy/orm/properties.py:194: SAWarning: On mapper Mapper|RecordMetadataVersion|records_metadata_version, primary key column 'records_metadata_version.transaction_id' is being combined with distinct primary key column 'records_metadata_version.transaction_id' in attribute 'transaction_id'.  Use explicit properties to give each column its own mapped attribute name.
  self.columns[0], self.key))

Python 2.7.12 (default, Oct 11 2016, 05:20:59)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
IPython: 5.1.0
App: inspirehep [debug]
Instance: /Users/jacquerie/.virtualenvs/inspire/bin/../var/inspirehep-instance

In [1]:

which gets even more annoying when you are executing several inspirehep commands in a row, like in scripts/clean_assets.

@jacquerie
Copy link
Contributor Author

We have a few more:

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.admin is deprecated, use flask_admin instead.
  .format(x=modname), ExtDeprecationWarning

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.admin.contrib is deprecated, use flask_admin.contrib instead.
  .format(x=modname), ExtDeprecationWarning

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.admin.contrib.sqla is deprecated, use flask_admin.contrib.sqla instead.
  .format(x=modname), ExtDeprecationWarning

/Users/jacquerie/.virtualenvs/inspire/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py:754: SADeprecationWarning: Use .target
  obj.__dict__[self.__name__] = result = self.fget(obj)

First three will be fixed by inveniosoftware/invenio-oauthclient#106, fourth one is harder.

@jacquerie
Copy link
Contributor Author

jacquerie commented Mar 20, 2017

Fourth one is caused by Flask-Admin, specifically this line: https://github.com/flask-admin/flask-admin/blob/1fa4ba80052910fed4f80bc339b0f04955233ed4/flask_admin/contrib/sqla/view.py#L597. I submitted a PR for it: pallets-eco/flask-admin#1447.

@jacquerie
Copy link
Contributor Author

Yet another squashed warning: inveniosoftware/invenio-rest#67.

@jacquerie jacquerie removed their assignment May 11, 2017
@jacquerie
Copy link
Contributor Author

Another small one will be fixed by inveniosoftware/invenio-accounts#229.

@jacquerie jacquerie self-assigned this Aug 10, 2017
@jacquerie
Copy link
Contributor Author

And another small one by inveniosoftware/invenio-accounts#245.

@jacquerie
Copy link
Contributor Author

The last two come from SQLAlchemy-Continuum. I'm not sure where, but note that this warning is happening upstream as well, so maybe the culprit is not in INSPIRE: https://travis-ci.org/inveniosoftware/invenio-records-rest/jobs/166397399#L591.

I now know that this comes from invenio-db: the logic in https://github.com/inveniosoftware/invenio-db/blob/5e387bbbbd494553af4ff960dd09941cd4dec9ac/invenio_db/ext.py#L104-L156 might be instantiating the records_metadata table more times than necessary.

@jacquerie jacquerie assigned jacquerie and unassigned jacquerie Sep 29, 2017
@jacquerie
Copy link
Contributor Author

I now know that this comes from invenio-db: the logic in https://github.com/inveniosoftware/invenio-db/blob/5e387bbbbd494553af4ff960dd09941cd4dec9ac/invenio_db/ext.py#L104-L156 might be instantiating the records_metadata table more times than necessary.

Tracked (and explained) in inveniosoftware/invenio-db#96.

@jacquerie
Copy link
Contributor Author

Tracked (and explained) in inveniosoftware/invenio-db#96.

...and finally solved by @slint, who will get a 🍺 next time I see him.

@jacquerie
Copy link
Contributor Author

Since all these warnings are now fixed in commits that are at worst pending a new release of the libraries they are in, we can close this.

@jacquerie jacquerie removed their assignment Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants