diff --git a/python-package/lightgbm/arrow.py b/python-package/lightgbm/arrow.py index 9bd510adc5c4..f89c4a7e3fca 100644 --- a/python-package/lightgbm/arrow.py +++ b/python-package/lightgbm/arrow.py @@ -1,3 +1,5 @@ +# coding: utf-8 +"""Utilities for handling Arrow in LightGBM.""" from contextlib import contextmanager from dataclasses import dataclass from typing import Iterator, Union @@ -16,10 +18,12 @@ class ArrowCArray: @property def chunks_ptr(self) -> int: + """Returns the address of the pointer to the list of chunks making up the array.""" return int(ffi.cast("uintptr_t", ffi.addressof(self.chunks[0]))) @property def schema_ptr(self) -> int: + """Returns the address of the pointer to the schema of the array.""" return int(ffi.cast("uintptr_t", self.schema)) diff --git a/tests/python_package_test/test_arrow.py b/tests/python_package_test/test_arrow.py index bbb1a82ece93..e105772e809f 100644 --- a/tests/python_package_test/test_arrow.py +++ b/tests/python_package_test/test_arrow.py @@ -6,7 +6,6 @@ import lightgbm as lgb import numpy as np -import pandas as pd import pyarrow as pa import pytest