cms-bril / brilws

MIT License
1 stars 3 forks source link

Py310 #1

Closed xiezhen closed 1 year ago

xiezhen commented 1 year ago

update for python 310, no more python2 compatible

clelange commented 1 year ago

Awesome, thanks!

clelange commented 1 year ago

Could you please also release version 3.8.1 on PyPI?

xiezhen commented 1 year ago

I uploaded it to PyPI. I won't announce it until I fix the documentation etc. But you can use it.

clelange commented 1 year ago

Thank you!

Did you also happen to fix the issues with the frontier dialect (and if so, where can I find it)? Do you take it from http://frontier.cern.ch/dist/ ?

I currently get the following warning:

> brilcalc lumi -c web -r 284077
/home/bril/.local/lib/python3.10/site-packages/brilws/api.py:930: SAWarning: Dialect oracle:frontier will not make use of SQL compilation caching as it does not set the 'supports_statement_cache' attribute to ``True``.  This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions.  Dialect maintainers should seek to set this attribute to True after appropriate development and testing for SQLAlchemy 1.4 caching support.   Alternatively, this attribute may be set to False which will disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf)
  row = connection.execute(text(q),binddict).fetchone()
xiezhen commented 1 year ago

my fix of frontier dialect is not in the client code. The client code contains only change to match python310.

clelange commented 1 year ago

Do you think it's OK to set supports_statement_cache = False for now to get rid of the warning?

xiezhen commented 1 year ago

did you use a too much advanced version of sqlalchemy ? I tested with sqlalchemy 1.3.24, everything is fine. Could you try this version? I don't want to go too advanced with sqlalchemy version

xiezhen commented 1 year ago

This combination is in my current brilconda build:

clelange commented 1 year ago

Thanks for the list. Yes, I'm using SQLAlchemy 1.4.49 (requiring SQLAlchemy<2) -- I guess I'll also just downgrade to 1.3.x.

xiezhen commented 1 year ago

well, you can tell me where to put statement supports_statement_cache = False, so that I can use it for the future upgrade of sqlalchemy in brilconda.

clelange commented 1 year ago

OK, I'll try to figure this out, but probably won't manage today anymore. Thanks for your help!

clelange commented 1 year ago

Here's the fix: https://gitlab.cern.ch/cms-cloud/brilws-docker/-/commit/698a3166d7b75c429fadb232c9576199b06b0c0b