Skip to content

Commit

Permalink
PR feedback, fix logging frame depth.
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkzinzow committed Sep 14, 2023
1 parent bdb4544 commit 53b6dfa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
26 changes: 24 additions & 2 deletions daft/daft.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,38 @@ class S3Config:
I/O configuration for accessing an S3-compatible system.
"""

def __init__(
self,
region_name: str | None = None,
endpoint_url: str | None = None,
key_id: str | None = None,
session_token: str | None = None,
access_key: str | None = None,
max_connections: int | None = None,
retry_initial_backoff_ms: int | None = None,
connect_timeout_ms: int | None = None,
read_timeout_ms: int | None = None,
num_tries: int | None = None,
retry_mode: str | None = None,
anonymous: bool | None = None,
): ...

class AzureConfig:
"""
I/O configuration for accessing Azure Blob Storage.
"""

def __init__(
self, storage_account: str | None = None, access_key: str | None = None, anonymous: str | None = None
): ...

class GCSConfig:
"""
I/O configuration for accessing Google Cloud Storage.
"""

def __init__(self, project_id: str | None = None, anonymous: bool | None = None): ...

class IOConfig:
"""
Configuration for the native I/O layer, e.g. credentials for accessing cloud storage systems.
Expand All @@ -302,7 +324,7 @@ class NativeStorageConfig:

io_config: IOConfig

def __init__(self, io_config: IOConfig): ...
def __init__(self, io_config: IOConfig | None = None): ...

class PythonStorageConfig:
"""
Expand All @@ -311,7 +333,7 @@ class PythonStorageConfig:

fs: fsspec.AbstractFileSystem

def __init__(self, fs: fsspec.AbstractFileSystem): ...
def __init__(self, fs: fsspec.AbstractFileSystem | None = None): ...

class StorageConfig:
"""
Expand Down
3 changes: 0 additions & 3 deletions daft/io/_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from daft.api_annotations import PublicAPI
from daft.daft import (
FileFormatConfig,
IOConfig,
NativeStorageConfig,
ParquetSourceConfig,
PythonStorageConfig,
Expand Down Expand Up @@ -56,8 +55,6 @@ def read_parquet(

file_format_config = FileFormatConfig.from_parquet_config(ParquetSourceConfig())
if use_native_downloader:
if io_config is None:
io_config = IOConfig()
storage_config = StorageConfig.native(NativeStorageConfig(io_config))
else:
storage_config = StorageConfig.python(PythonStorageConfig(fs))
Expand Down
2 changes: 1 addition & 1 deletion daft/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def emit(self, record: logging.LogRecord) -> None:
frame = frame.f_back
depth += 1

logger.opt(depth=depth, exception=record.exc_info).log(level, record.getMessage())
logger.opt(depth=depth - 1, exception=record.exc_info).log(level, record.getMessage())

# Clear out any existing standard loggers.
root = logging.root
Expand Down

0 comments on commit 53b6dfa

Please sign in to comment.