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

Make the tests pass. #358

Open
stankudrow opened this issue Dec 22, 2024 · 1 comment
Open

Make the tests pass. #358

stankudrow opened this issue Dec 22, 2024 · 1 comment

Comments

@stankudrow
Copy link

stankudrow commented Dec 22, 2024

Bug description

When running the tests/types/test_json.py under pytest, the following error occurs:

clickhouse_driver.errors.ServerException: Code: 44.
E           DB::Exception: Cannot create column with type 'JSON' because experimental JSON type is not allowed. Set setting allow_experimental_json_type = 1 in order to allow it.

When adding the following line after these ones:

self.session.execute(
    text('SET allow_experimental_json_type = 1;')
)

...another error occurs:

clickhouse_driver.errors.UnknownTypeError: Code: 50. Unknown type JSON

Both lead to clickhouse_driver packages, but posted here cause found here.

Versions:

╰─➤  python3 --version
Python 3.9.21
╰─➤  uv pip list
Package               Version    Editable project location
--------------------- ---------- -----------------------------------------------
alembic               1.14.0
asynch                0.2.4
certifi               2024.12.14
charset-normalizer    3.4.0
ciso8601              2.3.2
clickhouse-driver     0.2.9
clickhouse-sqlalchemy 0.3.2      /.../clickhouse-sqlalchemy
exceptiongroup        1.2.2
greenlet              3.1.1
idna                  3.10
iniconfig             2.0.0
leb128                1.0.8
lz4                   4.3.3
mako                  1.3.8
markupsafe            3.0.2
packaging             24.2
parameterized         0.9.0
pip                   24.3.1
pluggy                1.5.0
pytest                8.3.4
pytest-asyncio        0.25.0
pytz                  2024.2
pyupgrade             3.19.1
pyyaml                6.0.2
requests              2.32.3
responses             0.25.3
sqlalchemy            2.0.0
tokenize-rt           6.1.0
tomli                 2.2.1
typing-extensions     4.12.2
tzlocal               5.2
urllib3               2.3.0
zstd                  1.5.5.1

Note: the environment was made with uv venv --python 3.9, then uv pip install ... command(s).

ClickHouse version (a docker container in use):

─➤  docker exec -it some-clickhouse-server clickhouse-client
ClickHouse client version 24.10.2.80 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 24.10.2.

Warnings:
 * Delay accounting is not enabled, OSIOWaitMicroseconds will not be gathered. You can enable it using `echo 1 > /proc/sys/kernel/task_delayacct` or by using sysctl.
@stankudrow stankudrow mentioned this issue Dec 22, 2024
5 tasks
@stankudrow stankudrow changed the title The tests/types/test_json.py module fails (?) Make the tests pass. Feb 5, 2025
@stankudrow
Copy link
Author

Related to the #357 , but this PR does not solve the root of the problem and it only eliminates some warnings, resolves some issues on test collection and a test on the JSON type is skipped via intercepting the code 50 exception. For more details, please refer to this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant