You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ".../example.py", line 23, in <module>
print(next(request.all().values.query()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/wetterdienst/core/timeseries/values.py", line 443, in query
station_df = self._convert_values_to_si(station_df, datasets)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/wetterdienst/core/timeseries/values.py", line 232, in _convert_values_to_si
group = group.with_columns(pl.col(Columns.VALUE.value).map_batches(lambda s, o=op, f=factor: o(s, f)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/polars/dataframe/frame.py", line 8027, in with_columns
return self.lazy().with_columns(*exprs, **named_exprs).collect(_eager=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/polars/utils/deprecation.py", line 100, in wrapper
return function(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../site-packages/polars/lazyframe/frame.py", line 1788, in collect
return wrap_df(ldf.collect())
^^^^^^^^^^^^^
polars.exceptions.ComputeError: TypeError: argument 'val': iteration over a 0-d array
Running the same code with force_ndarray_like=False runs just fine.
Expected behavior
Allow the querying of station data with a pint unit registry configured with force_ndarray_like=True.
Desktop (please complete the following information):
OS: Linux
Python-Version 3.11
polars version 0.19.19
wetterdienst version 0.71.0
pint version 0.22
Additional context
I've had to use the configuration force_ndarray_like=True because it is currently required if I want to use pint-xarray (see xarray-contrib/pint-xarray#216).
I realize this bug is not necessarily the responsibility of wetterdienst, but perhaps there exists an easy change in this project that would fix this issue.
The text was updated successfully, but these errors were encountered:
Describe the bug
Querying station data fails when using a pint unit registry configured with
force_ndarray_like=True
.To Reproduce
Running the following code raises an exception:
The exception is raised with traceback:
Running the same code with
force_ndarray_like=False
runs just fine.Expected behavior
Allow the querying of station data with a pint unit registry configured with
force_ndarray_like=True
.Desktop (please complete the following information):
Additional context
I've had to use the configuration
force_ndarray_like=True
because it is currently required if I want to usepint-xarray
(see xarray-contrib/pint-xarray#216).I realize this bug is not necessarily the responsibility of
wetterdienst
, but perhaps there exists an easy change in this project that would fix this issue.The text was updated successfully, but these errors were encountered: