Skip to content

Commit

Permalink
Fix import when pandas/pyarrow not installed (#678)
Browse files Browse the repository at this point in the history
## Available PR templates

<!--
Github doesn't allow PR template selection the same way that it is
possible with issues.
  Preview this and select the appropriate template
-->

- [Default](?expand=1&template=default.md)
- [Version Release](?expand=1&template=version_release.md)
- _Alternatively delete and start empty_
  • Loading branch information
kylebarron authored Oct 8, 2024
1 parent 8202ca5 commit 2409608
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
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

0 comments on commit 2409608

Please sign in to comment.