Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import when pandas/pyarrow not installed #678

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [0.10.1] - 2024-10-08

### Fixes :bug:

- Fix import when pandas not installed.

## [0.10.0] - 2024-10-07

### New! :sparkles:
Expand Down Expand Up @@ -29,7 +35,7 @@
- Fix reading from DuckDB with only geometry column by @kylebarron in https://github.com/developmentseed/lonboard/pull/625
- Fix attribution by @vgeorge in https://github.com/developmentseed/lonboard/pull/561

## New Contributors
### New Contributors

- @MarcSkovMadsen made their first contribution in https://github.com/developmentseed/lonboard/pull/539
- @ATL2001 made their first contribution in https://github.com/developmentseed/lonboard/pull/655
Expand Down
29 changes: 16 additions & 13 deletions lonboard/types/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
from typing import (
TYPE_CHECKING,
List,
Literal,
Sequence,
Expand All @@ -10,8 +11,6 @@
)

import numpy as np
import pandas as pd
import pyarrow
from arro3.core.types import ArrowArrayExportable, ArrowStreamExportable
from numpy.typing import NDArray

Expand All @@ -22,6 +21,10 @@
else:
from typing_extensions import TypedDict

if TYPE_CHECKING:
import pandas as pd
import pyarrow


IntFloat = Union[int, float]
Units = Literal["meters", "common", "pixels"]
Expand All @@ -32,18 +35,18 @@
Tuple[int, ...],
str,
NDArray[np.uint8],
pyarrow.FixedSizeListArray,
pyarrow.ChunkedArray,
"pyarrow.FixedSizeListArray",
"pyarrow.ChunkedArray",
ArrowArrayExportable,
ArrowStreamExportable,
]
FloatAccessorInput = Union[
int,
float,
NDArray[np.number],
pd.Series,
pyarrow.FloatingPointArray,
pyarrow.ChunkedArray,
"pd.Series",
"pyarrow.FloatingPointArray",
"pyarrow.ChunkedArray",
ArrowArrayExportable,
ArrowStreamExportable,
]
Expand All @@ -52,18 +55,18 @@
Tuple[int, int, int],
Tuple[int, ...],
NDArray[np.floating],
pyarrow.FixedSizeListArray,
pyarrow.ChunkedArray,
"pyarrow.FixedSizeListArray",
"pyarrow.ChunkedArray",
ArrowArrayExportable,
ArrowStreamExportable,
]
TextAccessorInput = Union[
str,
NDArray[np.str_],
pd.Series,
pyarrow.StringArray,
pyarrow.LargeStringArray,
pyarrow.ChunkedArray,
"pd.Series",
"pyarrow.StringArray",
"pyarrow.LargeStringArray",
"pyarrow.ChunkedArray",
ArrowArrayExportable,
ArrowStreamExportable,
]
Expand Down