caicancai opened a new issue, #45226:
URL: https://github.com/apache/airflow/issues/45226
### Apache Airflow version
2.10.4
### If "Other Airflow 2 version" selected, which one?
_No response_
### What happened?
```
def show_tables():
client = clickhouse_connect.create_client(
interface="https",
host='localhost',
port=9090,
user='default',
password='123456',
ca_cert='/Users/cc.cai/develop/clickhouse/testing/testing-ca.crt'
)
result = client.command("select 1")
print(result)
```
The above python can be executed locally, but when I use pythonoperator, an
error is reported
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from clickhouse_connect import get_client
from dill import settings
from sqlalchemy_utils.types.enriched_datetime.pendulum_datetime import
pendulum
import datetime
import clickhouse_connect
```
def show_tables():
client = clickhouse_connect.create_client(
interface="https",
host='localhost',
port=9090,
user='default',
password='123456',
ca_cert='/Users/cc.cai/develop/clickhouse/testing/testing-ca.crt'
)
result = client.command("select 1")
print(result)
with DAG(
dag_id="example_python_operator",
schedule="0 0 * * *",
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False,
dagrun_timeout=datetime.timedelta(minutes=60),
tags=["example", "example2"],
params={"example_key": "example_value"},
) as dag:
show_tables_task = PythonOperator(
task_id='show_tables_task',
python_callable=show_tables,
dag=dag
)
```
Max retries exceeded with url: /? (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed
### What you think should happen instead?
_No response_
### How to reproduce
```
def show_tables():
client = clickhouse_connect.create_client(
interface="https",
host='localhost',
port=9090,
user='default',
password='123456',
ca_cert='/Users/cc.cai/develop/clickhouse/testing/testing-ca.crt'
)
result = client.command("select 1")
print(result)
```
The above python can be executed locally, but when I use pythonoperator, an
error is reported
from airflow import DAG
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from clickhouse_connect import get_client
from dill import settings
from sqlalchemy_utils.types.enriched_datetime.pendulum_datetime import
pendulum
import datetime
import clickhouse_connect
```
def show_tables():
client = clickhouse_connect.create_client(
interface="https",
host='localhost',
port=9090,
user='default',
password='123456',
ca_cert='/Users/cc.cai/develop/clickhouse/testing/testing-ca.crt'
)
result = client.command("select 1")
print(result)
with DAG(
dag_id="example_python_operator",
schedule="0 0 * * *",
start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
catchup=False,
dagrun_timeout=datetime.timedelta(minutes=60),
tags=["example", "example2"],
params={"example_key": "example_value"},
) as dag:
show_tables_task = PythonOperator(
task_id='show_tables_task',
python_callable=show_tables,
dag=dag
)
```
Max retries exceeded with url: /? (Caused by
SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed
### Operating System
pythonoperator
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else?
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]