Skip to content

Bug in Stations module #153

Open
Open
@tomaslg

Description

@tomaslg

Hi,

I was setting a different computer after writing my code (which worked on my previous machine) and found the following issue:

Packages versions:
meteostat-1.6.7
pandas-2.1.3

Within Python 3.11.7 (main, Dec 15 2023, 18:12:31) [GCC 11.2.0] on linux I run:

from meteostat import Stations; Stations().nearby(-33.25531944281872, 150.67298892336152)

Then I get the following error:

Traceback (most recent call last):
File "", line 1, in
File "/home/tomas/anaconda3/lib/python3.11/site-packages/meteostat/interface/stations.py", line 128, in nearby
temp._data = temp._data.sort_values("distance")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/frame.py", line 6974, in sort_values
new_data = self._mgr.take(
^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 877, in take
return self.reindex_indexer(
^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 670, in reindex_indexer
new_blocks = [
^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 675, in
fill_value if fill_value is not None else blk.fill_value
^^^^^^^^^^^^^^
File "properties.pyx", line 36, in pandas.libs.properties.CachedProperty.get
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/internals/blocks.py", line 230, in fill_value
return na_value_for_dtype(self.dtype, compat=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/dtypes/missing.py", line 670, in na_value_for_dtype
return dtype.na_value
^^^^^^^^^^^^^^
File "/home/tomas/anaconda3/lib/python3.11/site-packages/pandas/core/arrays/string
.py", line 106, in na_value
if self.storage == "pyarrow_numpy":
^^^^^^^^^^^^
AttributeError: 'StringDtype' object has no attribute 'storage'

I would greatly appreciate if you could help me sort out this problem or fix it in future versions.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions