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

bug: UTC issue with MySQL backend #6010

Closed
1 task done
ededovic opened this issue Apr 14, 2023 · 10 comments · Fixed by #6027
Closed
1 task done

bug: UTC issue with MySQL backend #6010

ededovic opened this issue Apr 14, 2023 · 10 comments · Fixed by #6027
Labels
bug Incorrect behavior inside of ibis mysql The MySQL backend
Milestone

Comments

@ededovic
Copy link

What happened?

when trying to connect to ibis.mysql.connect(host='...', user='...',password='...', database='...'), I get this error:

pymysql.err.OperationalError: (1298, "Unknown or incorrect time zone: 'UTC'")
...
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1298, "Unknown or incorrect time zone: 'UTC'")

coming from here:

File "...\envs\ml310\lib\site-packages\ibis\backends\mysql\__init__.py", line 107, in connect
cur.execute("SET @@session.time_zone = 'UTC'")

when I change it to SYSTEM, it works:

cur.execute("SET @@session.time_zone = 'SYSTEM'")

What version of ibis are you using?

5.1

What backend(s) are you using, if any?

mysql

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ededovic ededovic added the bug Incorrect behavior inside of ibis label Apr 14, 2023
@cpcloud
Copy link
Member

cpcloud commented Apr 15, 2023

Hi @ededovic 👋🏻!

Thanks for the issue.

To help us debug, are you using MariaDB or MySQL, or something else entirely?

Our CI tests against MariaDB so we might have some unintentional assumptions that only apply to MariaDB.

@cpcloud cpcloud added the mysql The MySQL backend label Apr 15, 2023
@ededovic
Copy link
Author

ededovic commented Apr 16, 2023

I'm using Percona 8.0.25-15, I think it is some kind of variant of MySQL.
Oddly, it fails to connect even when using MariaDB 5.5. It only takes in SYSTEM not UTC.

@cpcloud
Copy link
Member

cpcloud commented Apr 17, 2023

I'm using Percona 8.0.25-15, I think it is some kind of variant of MySQL. Oddly, it fails to connect even when using MariaDB 5.5. It only takes in SYSTEM not UTC.

It's almost certainly unrelated to the version or even implentation of MySQL in this case and more likely that time zone tables in the database aren't populated.

There's not much we can do about a timezone-impoverished setup, except to avoid failing when setting the session time zone. I can put up a PR to catch the exception and show a warning when this happens.

@ivirshup
Copy link

Just in case a 5.1.1 release may happen before 6.0.0, I would note that older versions of ibis would not throw an error here.

On ibis 4.10 I can connect to ensembl's databases like:

connection = ibis.mysql.connect("martdb.ensembl.org", user="anonymous", database="ensembl_compara_109")

But this fails on ibis 5.1.0 with the time zone error.

@cpcloud
Copy link
Member

cpcloud commented Apr 25, 2023

@ivirshup

There won't be a 5.1.1 release before 6.0.0.

Can you provide a reproducible example using a non-proprietary database?

It would also be helpful to know the difference in environments between your testing on 4.1 and 5.1.

Are you seeing warnings on 4.1 and no failure, or are you actually successfully setting the timezone?

Nothing much about the code around setting the timezone has changed between 4.1 and 5.1 changed IIRC.

@cpcloud
Copy link
Member

cpcloud commented Apr 25, 2023

@ivirshup Likely what you're seeing is from ed4b476, where we were previously catching all exceptions when setting the session time zone, but in that change we stopped catching exceptions.

6.0.0 contains a similar fix (from #6027) to warn about exceptions during setting the session time zone.

@ivirshup
Copy link

ivirshup commented Apr 25, 2023

Can you provide a reproducible example using a non-proprietary database?

I don't believe the ensembl databases are proprietary, the data should be freely available. Is this what you meant?

It would also be helpful to know the difference in environments between your testing on 4.1 and 5.1.

These were fresh installs in conda environments.

ibis 5.1.0 environment
# packages in environment at /Users/isaac/miniconda3/envs/ibis-5.1:
#
# Name                    Version                   Build  Channel
arrow-cpp                 11.0.0          h694c41f_14_cpu    conda-forge
atk-1.0                   2.38.0               h1d18e73_1    conda-forge
atpublic                  3.0.1              pyhd8ed1ab_0    conda-forge
aws-c-auth                0.6.26               hcaaecf5_1    conda-forge
aws-c-cal                 0.5.21               hf54dd2f_2    conda-forge
aws-c-common              0.8.14               hb7f2c08_0    conda-forge
aws-c-compression         0.2.16               h99c63db_5    conda-forge
aws-c-event-stream        0.2.20               h0ae4c0f_4    conda-forge
aws-c-http                0.7.6                hcdd7835_0    conda-forge
aws-c-io                  0.13.19              had634fe_3    conda-forge
aws-c-mqtt                0.8.6               ha4e05e3_12    conda-forge
aws-c-s3                  0.2.7                hba8c00c_1    conda-forge
aws-c-sdkutils            0.1.8                h99c63db_0    conda-forge
aws-checksums             0.1.14               h99c63db_5    conda-forge
aws-crt-cpp               0.19.8              h8b21dc2_12    conda-forge
aws-sdk-cpp               1.10.57              h0d082ec_8    conda-forge
bcrypt                    3.2.2           py310h90acd4f_1    conda-forge
bidict                    0.22.1             pyhd8ed1ab_0    conda-forge
brotlipy                  0.7.0           py310h90acd4f_1005    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.18.1               h0d85af4_0    conda-forge
ca-certificates           2022.12.7            h033912b_0    conda-forge
cairo                     1.16.0            h297c08e_1015    conda-forge
certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
cffi                      1.15.1          py310ha78151a_3    conda-forge
charset-normalizer        3.1.0              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
cryptography              40.0.2          py310hdd0c95c_0    conda-forge
duckdb-engine             0.7.0              pyhd8ed1ab_0    conda-forge
dunamai                   1.16.0             pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hf0c8a7f_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h3f81eb7_1    conda-forge
fribidi                   1.0.10               hbcb3906_0    conda-forge
gdk-pixbuf                2.42.10              hff535ac_2    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
gflags                    2.2.2             hb1e8313_1004    conda-forge
giflib                    5.2.1                hb7f2c08_3    conda-forge
glog                      0.6.0                h8ac2a54_0    conda-forge
graphite2                 1.3.13            h2e338ed_1001    conda-forge
graphviz                  8.0.3                hc51f7b9_0    conda-forge
greenlet                  2.0.2           py310h7a76584_0    conda-forge
gtk2                      2.24.33              h7c1209e_2    conda-forge
gts                       0.7.6                hccb3bdf_2    conda-forge
harfbuzz                  7.1.0                hc28939c_1    conda-forge
ibis-framework            5.1.0                hd8ed1ab_0    conda-forge
ibis-framework-core       5.1.0              pyhd8ed1ab_0    conda-forge
icu                       72.1                 h7336db1_0    conda-forge
idna                      3.4                pyhd8ed1ab_0    conda-forge
importlib-metadata        6.6.0              pyha770c72_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
krb5                      1.20.1               h049b76e_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libabseil                 20230125.0      cxx17_hf0c8a7f_1    conda-forge
libarrow                  11.0.0          h062d8ff_14_cpu    conda-forge
libblas                   3.9.0           16_osx64_openblas    conda-forge
libbrotlicommon           1.0.9                hb7f2c08_8    conda-forge
libbrotlidec              1.0.9                hb7f2c08_8    conda-forge
libbrotlienc              1.0.9                hb7f2c08_8    conda-forge
libcblas                  3.9.0           16_osx64_openblas    conda-forge
libcrc32c                 1.1.2                he49afe7_0    conda-forge
libcurl                   8.0.1                h1fead75_0    conda-forge
libcxx                    16.0.2               hd57cbcb_0    conda-forge
libdeflate                1.18                 hac1461d_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libevent                  2.1.10               h7d65743_4    conda-forge
libexpat                  2.5.0                hf0c8a7f_1    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgd                     2.3.3                h3d994df_6    conda-forge
libgfortran               5.0.0           11_3_0_h97931a8_31    conda-forge
libgfortran5              12.2.0              he409387_31    conda-forge
libglib                   2.76.2               hc62aa5d_0    conda-forge
libgoogle-cloud           2.8.0                h176059f_1    conda-forge
libgrpc                   1.52.1               h5bc3d57_1    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
libjpeg-turbo             2.1.5.1              hb7f2c08_0    conda-forge
liblapack                 3.9.0           16_osx64_openblas    conda-forge
libnghttp2                1.52.0               he2ab024_0    conda-forge
libopenblas               0.3.21          openmp_h429af6e_3    conda-forge
libpng                    1.6.39               ha978bb4_0    conda-forge
libprotobuf               3.21.12              hbc0c0cd_0    conda-forge
librsvg                   2.56.0               h123f2dd_0    conda-forge
libsodium                 1.0.18               hbcb3906_1    conda-forge
libsqlite                 3.40.0               ha978bb4_1    conda-forge
libssh2                   1.10.0               h47af595_3    conda-forge
libthrift                 0.18.1               h16802d8_0    conda-forge
libtiff                   4.5.0                hedf67fa_6    conda-forge
libtool                   2.4.7                hf0c8a7f_0    conda-forge
libutf8proc               2.8.0                hb7f2c08_0    conda-forge
libwebp                   1.3.0                ha9aa8fa_0    conda-forge
libwebp-base              1.3.0                hb7f2c08_0    conda-forge
libxml2                   2.10.4               h554bb67_0    conda-forge
libzlib                   1.2.13               hfd90126_4    conda-forge
llvm-openmp               16.0.2               hff08bdf_0    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
markdown-it-py            2.2.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.2           py310h90acd4f_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
numpy                     1.24.3          py310h7451ae0_0    conda-forge
openssl                   3.1.0                h8a1eda9_2    conda-forge
orc                       1.8.3                ha9d861c_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.0.1           py310h5e4fcda_0    conda-forge
pango                     1.50.14              hbce5e75_1    conda-forge
paramiko                  3.1.0              pyhd8ed1ab_0    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parsy                     2.1                pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h1c4e4bc_0    conda-forge
pip                       23.1.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
platformdirs              3.2.0              pyhd8ed1ab_0    conda-forge
poetry-dynamic-versioning 0.21.4             pyhd8ed1ab_0    conda-forge
pooch                     1.7.0              pyha770c72_3    conda-forge
pooch-extra               1.7.0              pyhd8ed1ab_3    conda-forge
pyarrow                   11.0.0          py310h062e888_14_cpu    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pymysql                   1.0.3              pyhd8ed1ab_0    conda-forge
pynacl                    1.5.0           py310h90acd4f_2    conda-forge
pyopenssl                 23.1.1             pyhd8ed1ab_0    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
python                    3.10.10         he7542f4_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-duckdb             0.7.1           py310h7853987_0    conda-forge
python-graphviz           0.20.1             pyh22cad53_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python-xxhash             3.2.0           py310h90acd4f_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
re2                       2023.02.02           hf0c8a7f_0    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
regex                     2023.3.23       py310h90acd4f_0    conda-forge
requests                  2.28.2             pyhd8ed1ab_1    conda-forge
rich                      13.3.4             pyhd8ed1ab_0    conda-forge
setuptools                67.7.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               h225ccf5_0    conda-forge
sqlalchemy                2.0.10          py310h6729b98_0    conda-forge
sqlalchemy-views          0.3.2              pyhd8ed1ab_0    conda-forge
sqlglot                   11.5.7             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
tomlkit                   0.11.7             pyha770c72_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
typing                    3.10.0.0           pyhd8ed1ab_0    conda-forge
typing-extensions         4.5.0                hd8ed1ab_0    conda-forge
typing_extensions         4.5.0              pyha770c72_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
urllib3                   1.26.15            pyhd8ed1ab_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xxhash                    0.8.1                h45a561f_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hfd90126_4    conda-forge
zstd                      1.5.2                hbc0c0cd_6    conda-forge

ibis 4.1.0 environment
# packages in environment at /Users/isaac/miniconda3/envs/ibis-4:
#
# Name                    Version                   Build  Channel
arrow-cpp                 11.0.0          h694c41f_14_cpu    conda-forge
atk-1.0                   2.38.0               h1d18e73_1    conda-forge
atpublic                  3.0.1              pyhd8ed1ab_0    conda-forge
aws-c-auth                0.6.26               hcaaecf5_1    conda-forge
aws-c-cal                 0.5.21               hf54dd2f_2    conda-forge
aws-c-common              0.8.14               hb7f2c08_0    conda-forge
aws-c-compression         0.2.16               h99c63db_5    conda-forge
aws-c-event-stream        0.2.20               h0ae4c0f_4    conda-forge
aws-c-http                0.7.6                hcdd7835_0    conda-forge
aws-c-io                  0.13.19              had634fe_3    conda-forge
aws-c-mqtt                0.8.6               ha4e05e3_12    conda-forge
aws-c-s3                  0.2.7                hba8c00c_1    conda-forge
aws-c-sdkutils            0.1.8                h99c63db_0    conda-forge
aws-checksums             0.1.14               h99c63db_5    conda-forge
aws-crt-cpp               0.19.8              h8b21dc2_12    conda-forge
aws-sdk-cpp               1.10.57              h0d082ec_8    conda-forge
bzip2                     1.0.8                h0d85af4_4    conda-forge
c-ares                    1.18.1               h0d85af4_0    conda-forge
ca-certificates           2022.12.7            h033912b_0    conda-forge
cairo                     1.16.0            h297c08e_1015    conda-forge
duckdb-engine             0.7.0              pyhd8ed1ab_0    conda-forge
dunamai                   1.16.0             pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hf0c8a7f_1    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h5bb23bf_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               h3f81eb7_1    conda-forge
fribidi                   1.0.10               hbcb3906_0    conda-forge
gdk-pixbuf                2.42.10              hff535ac_2    conda-forge
gettext                   0.21.1               h8a4c099_0    conda-forge
gflags                    2.2.2             hb1e8313_1004    conda-forge
giflib                    5.2.1                hb7f2c08_3    conda-forge
glog                      0.6.0                h8ac2a54_0    conda-forge
graphite2                 1.3.13            h2e338ed_1001    conda-forge
graphviz                  8.0.3                hc51f7b9_0    conda-forge
greenlet                  2.0.2           py310h7a76584_0    conda-forge
gtk2                      2.24.33              h7c1209e_2    conda-forge
gts                       0.7.6                hccb3bdf_2    conda-forge
harfbuzz                  7.1.0                hc28939c_1    conda-forge
ibis-framework            4.1.0                hd8ed1ab_1    conda-forge
ibis-framework-core       4.1.0              pyhd8ed1ab_1    conda-forge
icu                       72.1                 h7336db1_0    conda-forge
importlib-metadata        6.6.0              pyha770c72_0    conda-forge
jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
krb5                      1.20.1               h049b76e_0    conda-forge
lerc                      4.0.0                hb486fe8_0    conda-forge
libabseil                 20230125.0      cxx17_hf0c8a7f_1    conda-forge
libarrow                  11.0.0          h062d8ff_14_cpu    conda-forge
libblas                   3.9.0           16_osx64_openblas    conda-forge
libbrotlicommon           1.0.9                hb7f2c08_8    conda-forge
libbrotlidec              1.0.9                hb7f2c08_8    conda-forge
libbrotlienc              1.0.9                hb7f2c08_8    conda-forge
libcblas                  3.9.0           16_osx64_openblas    conda-forge
libcrc32c                 1.1.2                he49afe7_0    conda-forge
libcurl                   8.0.1                h1fead75_0    conda-forge
libcxx                    16.0.2               hd57cbcb_0    conda-forge
libdeflate                1.18                 hac1461d_0    conda-forge
libedit                   3.1.20191231         h0678c8f_2    conda-forge
libev                     4.33                 haf1e3a3_1    conda-forge
libevent                  2.1.10               h7d65743_4    conda-forge
libexpat                  2.5.0                hf0c8a7f_1    conda-forge
libffi                    3.4.2                h0d85af4_5    conda-forge
libgd                     2.3.3                h3d994df_6    conda-forge
libgfortran               5.0.0           11_3_0_h97931a8_31    conda-forge
libgfortran5              12.2.0              he409387_31    conda-forge
libglib                   2.76.2               hc62aa5d_0    conda-forge
libgoogle-cloud           2.8.0                h176059f_1    conda-forge
libgrpc                   1.52.1               h5bc3d57_1    conda-forge
libiconv                  1.17                 hac89ed1_0    conda-forge
libjpeg-turbo             2.1.5.1              hb7f2c08_0    conda-forge
liblapack                 3.9.0           16_osx64_openblas    conda-forge
libnghttp2                1.52.0               he2ab024_0    conda-forge
libopenblas               0.3.21          openmp_h429af6e_3    conda-forge
libpng                    1.6.39               ha978bb4_0    conda-forge
libprotobuf               3.21.12              hbc0c0cd_0    conda-forge
librsvg                   2.56.0               h123f2dd_0    conda-forge
libsqlite                 3.40.0               ha978bb4_1    conda-forge
libssh2                   1.10.0               h47af595_3    conda-forge
libthrift                 0.18.1               h16802d8_0    conda-forge
libtiff                   4.5.0                hedf67fa_6    conda-forge
libtool                   2.4.7                hf0c8a7f_0    conda-forge
libutf8proc               2.8.0                hb7f2c08_0    conda-forge
libwebp                   1.3.0                ha9aa8fa_0    conda-forge
libwebp-base              1.3.0                hb7f2c08_0    conda-forge
libxml2                   2.10.4               h554bb67_0    conda-forge
libzlib                   1.2.13               hfd90126_4    conda-forge
llvm-openmp               16.0.2               hff08bdf_0    conda-forge
lz4-c                     1.9.4                hf0c8a7f_0    conda-forge
markdown-it-py            2.2.0              pyhd8ed1ab_0    conda-forge
markupsafe                2.1.2           py310h90acd4f_0    conda-forge
mdurl                     0.1.0              pyhd8ed1ab_0    conda-forge
multipledispatch          0.6.0                      py_0    conda-forge
ncurses                   6.3                  h96cf925_1    conda-forge
numpy                     1.24.3          py310h7451ae0_0    conda-forge
openssl                   3.1.0                h8a1eda9_2    conda-forge
orc                       1.8.3                ha9d861c_0    conda-forge
packaging                 23.1               pyhd8ed1ab_0    conda-forge
pandas                    2.0.1           py310h5e4fcda_0    conda-forge
pango                     1.50.14              hbce5e75_1    conda-forge
parquet-cpp               1.5.1                         2    conda-forge
parsy                     2.1                pyhd8ed1ab_0    conda-forge
pcre2                     10.40                h1c4e4bc_0    conda-forge
pip                       23.1.1             pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               hbcb3906_0    conda-forge
poetry-dynamic-versioning 0.21.4             pyhd8ed1ab_0    conda-forge
pyarrow                   11.0.0          py310h062e888_14_cpu    conda-forge
pygments                  2.15.1             pyhd8ed1ab_0    conda-forge
pymysql                   1.0.3              pyhd8ed1ab_0    conda-forge
python                    3.10.10         he7542f4_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-duckdb             0.7.1           py310h7853987_0    conda-forge
python-graphviz           0.20.1             pyh22cad53_0    conda-forge
python-tzdata             2023.3             pyhd8ed1ab_0    conda-forge
python_abi                3.10                    3_cp310    conda-forge
pytz                      2023.3             pyhd8ed1ab_0    conda-forge
re2                       2023.02.02           hf0c8a7f_0    conda-forge
readline                  8.2                  h9e318b2_1    conda-forge
regex                     2023.3.23       py310h90acd4f_0    conda-forge
rich                      13.3.4             pyhd8ed1ab_0    conda-forge
setuptools                67.7.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
snappy                    1.1.10               h225ccf5_0    conda-forge
sqlalchemy                1.4.46          py310h90acd4f_0    conda-forge
sqlalchemy-views          0.3.2              pyhd8ed1ab_0    conda-forge
sqlglot                   11.5.7             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h5dbffcc_0    conda-forge
tomlkit                   0.11.7             pyha770c72_0    conda-forge
toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
typing                    3.10.0.0           pyhd8ed1ab_0    conda-forge
typing_extensions         4.5.0              pyha770c72_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h775f41a_0    conda-forge
zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hfd90126_4    conda-forge
zstd                      1.5.2                hbc0c0cd_6    conda-forge

Are you seeing warnings on 4.1 and no failure, or are you actually successfully setting the timezone?

I get a UserWarning when I execute a query:

/Users/isaac/miniconda3/envs/ibis-4/lib/python3.10/site-packages/ibis/backends/mysql/__init__.py:113: UserWarning: Couldn't set MySQL timezone: (pymysql.err.OperationalError) (1298, "Unknown or incorrect time zone: 'UTC'")
[SQL: SET @@session.time_zone = 'UTC']

@cpcloud
Copy link
Member

cpcloud commented Apr 25, 2023

Yep, okay thanks for the information! I think my previous comment explains what you were seeing.

@soxv
Copy link

soxv commented Sep 9, 2023

Hi! I'm a new user of ibis. I encounter the same error when using the latest version (ibis-mysql) 6.1.0 despite you said the team has fixed it. I also tried 6.0.0 and 5.1.0. However, when I downgrade to 4.1.0, I only receive a warning.

@cpcloud
Copy link
Member

cpcloud commented Sep 10, 2023

@soxv Can you open a new bug report issue with the details of how the problem is manifesting?

cpcloud pushed a commit that referenced this issue Jan 8, 2024
## Description of changes

When trying to connect to a mySQL backend, the following error can
appear:

```
OperationalError: (pymysql.err.OperationalError) (1298, "Unknown or incorrect time zone: 'UTC'")
(Background on this error at: https://sqlalche.me/e/20/e3q8)
```

This is due to an exception generated by PyMySQL.
The exception, formerly generated by SQLAlchemy was already caught by
Ibis since #6010, this PR adds a catching of the PyMySQL exception.

## Issues closed
Resolves #7918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior inside of ibis mysql The MySQL backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants