prmoore77 commented on PR #14082:
URL: https://github.com/apache/arrow/pull/14082#issuecomment-1344791208
Hi @lidavidm - all is working now. Great work! Here is the Python and
output:
```import base64
import os
from dotenv import load_dotenv
import pyarrow.flight_sql
# Load our environment for the password...
load_dotenv(dotenv_path=".env")
flight_password = os.environ["FLIGHT_PASSWORD"]
authorization_header = f"Basic
{str(base64.b64encode(bytes(f'flight_username:{flight_password}',
encoding='utf-8')), encoding='utf-8')}"
with pyarrow.flight_sql.connect(uri="grpc+tls://localhost:31337",
db_kwargs={"arrow.flight.sql.authorization_header": authorization_header,
"arrow.flight.sql.client_option.disable_server_verification": "true"
}
) as conn:
with conn.cursor() as cur:
cur.execute("SELECT 1, 'hi', 2.0")
x = cur.fetch_arrow_table()
print(x)
```
Output:
```
pyarrow.Table
1: int64
'hi': string
2.0: double
----
1: [[1]]
'hi': [["hi"]]
2.0: [[2]]
```
--
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]