Skip to content

Correct typing of create_client(host, username) #482

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

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

biggerfisch
Copy link
Contributor

Summary

The parameters host and username of create_client actually do accept None values, as demonstrated by their default values being None and the docstring explaining default behavior when not-set.

Correcting these types (by marking as Optional) allows users using dsn or default behavior to not see type-checking errors.

Checklist

Delete items not relevant to your PR:

  • A human-readable description of the changes was provided to include in CHANGELOG

The parameters `host` and `username` of `create_client` actually do
accept None values, as demonstrated by their default values being `None`
and the docstring explaining default behavior when not-set.

Correcting these types (by marking as Optional) allows users using `dsn`
or default behavior to not see type-checking errors.
@genzgd
Copy link
Collaborator

genzgd commented Mar 21, 2025

Thanks for the cleanup

@genzgd genzgd merged commit 56e51bd into ClickHouse:main Mar 21, 2025
jovezhong pushed a commit to timeplus-io/timeplus-connect that referenced this pull request Apr 25, 2025
The parameters `host` and `username` of `create_client` actually do
accept None values, as demonstrated by their default values being `None`
and the docstring explaining default behavior when not-set.

Correcting these types (by marking as Optional) allows users using `dsn`
or default behavior to not see type-checking errors.
jovezhong added a commit to timeplus-io/timeplus-connect that referenced this pull request Apr 28, 2025
* Gg/update test jwt (ClickHouse#458)

* update test jwt, ensure query params are final

* tweak test job

* Assume CI "secret" is full JWT

* Fix lint

* Fix memory leak in AsyncClient (ClickHouse#457)

* Fix memory leak in AsyncClient

* Graceful shutdown

* fix test

* fix tests

* fix tests

* Fix lint (ClickHouse#459)

* Exclude 3.8 Aarch64 builds (ClickHouse#460)

* Fix lint

* Exclude pypy 38 build

* Exclude all Python 3.8 builds

* Update changelog re Python 3.8 aarch64 wheels

* Gg/update test matrix (ClickHouse#464)

* Update some tests

* Fix lint

* Skip JSON buggy test

* Fix CI tests with default user (ClickHouse#465)

* Replace removal of ; in the loop line with rstrip (ClickHouse#472)

* Docker test fixes (ClickHouse#473)

* Don't prevent settings that don't change the value

* Add docker related config file

* Fix typo

* Update README.md doc link (ClickHouse#476)

* Gg/update test jwt (ClickHouse#458)

* update test jwt, ensure query params are final

* tweak test job

* Assume CI "secret" is full JWT

* Fix lint

* Fix memory leak in AsyncClient (ClickHouse#457)

* Fix memory leak in AsyncClient

* Graceful shutdown

* fix test

* fix tests

* fix tests

* Fix lint (ClickHouse#459)

* Correct typing of create_client(host, username) (ClickHouse#482)

The parameters `host` and `username` of `create_client` actually do
accept None values, as demonstrated by their default values being `None`
and the docstring explaining default behavior when not-set.

Correcting these types (by marking as Optional) allows users using `dsn`
or default behavior to not see type-checking errors.

* Release 0 8 16 (ClickHouse#485)

* Check for optional libraries in client methods

* Log unexpected http next chunk unexpected

* Log unexpected http next chunk unexpected

* Updates for 0.8.16 release

* Exclude 3.8 Aarch64 builds (ClickHouse#460)

* Fix lint

* Exclude pypy 38 build

* Exclude all Python 3.8 builds

* Update changelog re Python 3.8 aarch64 wheels

* Gg/update test matrix (ClickHouse#464)

* Update some tests

* Fix lint

* Skip JSON buggy test

* Updates for 0.8.17 release (ClickHouse#488)

* Updates for 0.8.17 release

* Update test matrix

* Try to punt on SSL issues

* Update TLS test certificates

* Fix CI tests with default user (ClickHouse#465)

* Add param extra_http_headers to query/command methods (ClickHouse#489)

* Add param extra_http_headers to query/command methods

* add test, fix dict copy

---------

Co-authored-by: Geoff Genz <[email protected]>

* Change http_headers to transport settings, add transport settings to async client and insert methods (ClickHouse#490)

* wrap sql with text() (ClickHouse#491)

* Replace removal of ; in the loop line with rstrip (ClickHouse#472)

* Docker test fixes (ClickHouse#473)

* Don't prevent settings that don't change the value

* Add docker related config file

* Fix typo

* Update test_dynamic.py for variant and json data types

* Update httpclient.py

update comments

* Update dialect.py

* Update client.py

* Update test_jwt_auth.py

* bring back dbapi, otherwise test fails

* diable test_transport_settings in test_client.py

* fix the JSON->json data type name issue

---------

Co-authored-by: Geoff Genz <[email protected]>
Co-authored-by: pufit <[email protected]>
Co-authored-by: Sviatoslav Bobryshev <[email protected]>
Co-authored-by: Avery Fischer (biggerfisch) <[email protected]>
Co-authored-by: Paweł Szczur <[email protected]>
Co-authored-by: lakako <[email protected]>
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

Successfully merging this pull request may close these issues.

2 participants