1111# License for the specific language governing permissions and limitations
1212# under the License.
1313import os
14+ from typing import Optional
1415
1516import clickhouse_connect
1617from clickhouse_connect .driver .exceptions import Error as ClickhouseConnectError
@@ -52,12 +53,12 @@ class ClickHouseContainer(DbContainer):
5253
5354 def __init__ (
5455 self ,
55- image = "clickhouse/clickhouse-server:latest" ,
56- port = 9000 ,
57- user = None ,
58- password = None ,
59- dbname = None
60- ):
56+ image : str = "clickhouse/clickhouse-server:latest" ,
57+ port : int = 9000 ,
58+ user : Optional [ str ] = None ,
59+ password : Optional [ str ] = None ,
60+ dbname : Optional [ str ] = None
61+ ) -> None :
6162 super ().__init__ (image = image )
6263
6364 self .CLICKHOUSE_USER = user or self .CLICKHOUSE_USER
@@ -76,12 +77,12 @@ def _connect(self):
7677 client .execute ("SELECT version()" )
7778
7879
79- def _configure (self ):
80+ def _configure (self ) -> None :
8081 self .with_env ("CLICKHOUSE_USER" , self .CLICKHOUSE_USER )
8182 self .with_env ("CLICKHOUSE_PASSWORD" , self .CLICKHOUSE_PASSWORD )
8283 self .with_env ("CLICKHOUSE_DB" , self .CLICKHOUSE_DB )
8384
84- def get_connection_url (self , host = None ):
85+ def get_connection_url (self , host : Optional [ str ] = None ) -> str :
8586 return self ._create_connection_url (
8687 dialect = "clickhouse" ,
8788 username = self .CLICKHOUSE_USER ,
0 commit comments