Skip to content

Commit

Permalink
Allow LANCE_LOG to be set to trace
Browse files Browse the repository at this point in the history
  • Loading branch information
westonpace committed Dec 14, 2024
1 parent 99ae761 commit 89312f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion python/python/lance/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ def scanner(
"refine_factor": 1
}
batch_size: int, default None
The max size of batches returned.
The target size of batches returned. In some cases batches can be up to
twice this size (but never larger than this). In some cases batches can
be smaller than this size.
io_buffer_size: int, default None
The size of the IO buffer. See ``ScannerBuilder.io_buffer_size``
for more information.
Expand Down
9 changes: 8 additions & 1 deletion python/python/lance/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
ENV_NAME_PYLANCE_LOGGING_LEVEL = "LANCE_LOG"


# Rust has 'trace' and Python does not so we map it to 'debug'
def get_python_log_level(rust_log_level: str) -> str:
if rust_log_level.lower() == "trace":
return "DEBUG"
return rust_log_level


def get_log_level():
lance_log_level = os.environ.get(ENV_NAME_PYLANCE_LOGGING_LEVEL, "INFO").upper()
if lance_log_level == "":
Expand All @@ -17,7 +24,7 @@ def get_log_level():
entry for entry in lance_log_level.split(",") if "=" not in entry
]
if len(lance_log_level) > 0:
return lance_log_level[0]
return get_python_log_level(lance_log_level[0])
else:
return "INFO"

Expand Down

0 comments on commit 89312f5

Please sign in to comment.