-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] Set SSL paths on linux (#1203)
* Inject ssl cert env variables for linux machines
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
|
||
from daft.io._csv import read_csv | ||
from daft.io._json import read_json | ||
from daft.io.config import IOConfig, S3Config | ||
from daft.io.file_path import from_glob_path | ||
from daft.io.parquet import read_parquet | ||
|
||
|
||
def _set_linux_cert_paths(): | ||
import os | ||
import ssl | ||
|
||
paths = ssl.get_default_verify_paths() | ||
if paths.cafile: | ||
os.environ[paths.openssl_cafile_env] = paths.openssl_cafile | ||
if paths.capath: | ||
os.environ[paths.openssl_capath_env] = paths.openssl_capath | ||
|
||
|
||
if sys.platform == "linux": | ||
_set_linux_cert_paths() | ||
|
||
__all__ = ["read_csv", "read_json", "from_glob_path", "read_parquet", "IOConfig", "S3Config"] |