Skip to content

update workflow to work with new pandas version #147

@jcblemai

Description

@jcblemai

There was another recent build failure that i discovered to be caused by the latest pandas release (i think it happened today). i fixed the issue by pinning our pandas installation in the build-deploy github workflow to 2.2.3.

RespiLens should work with latest pandas.

https://github.com/ACCIDDA/RespiLens/actions/runs/21220830841/job/61054808766 (but will get deleted so copy paste

INFO:__main__:Collecting data from FluSight repo...
/home/runner/work/RespiLens/RespiLens/scripts/helper.py:66: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
  date_output_ids = pd.to_datetime(df['output_type_id'], errors='coerce')
Traceback (most recent call last):
  File "/home/runner/work/RespiLens/RespiLens/scripts/process_RespiLens_data.py", line 157, in <module>
    main()
  File "/home/runner/work/RespiLens/RespiLens/scripts/process_RespiLens_data.py", line 61, in main
    flu_hubverse_df = clean_nan_values(hubverse_df_preprocessor(df=flu_hub_conn.get_dataset().to_table().to_pandas(), filter_nowcasts=True))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/RespiLens/RespiLens/scripts/helper.py", line 72, in hubverse_df_preprocessor
    df.loc[quantile_mask, 'output_type_id'] = df.loc[quantile_mask, 'output_type_id'].astype(float)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/indexing.py", line 938, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/indexing.py", line 1953, in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/indexing.py", line 1997, in _setitem_with_indexer_split_path
    self._setitem_single_column(ilocs[0], value, pi)
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/indexing.py", line 2181, in _setitem_single_column
    self.obj._mgr.column_setitem(loc, plane_indexer, value)
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 1503, in column_setitem
    new_mgr = col_mgr.setitem((idx,), value)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 604, in setitem
    return self.apply("setitem", indexer=indexer, value=value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 442, in apply
    applied = getattr(b, f)(**kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/internals/blocks.py", line 1667, in setitem
    values[indexer] = value
    ~~~~~~^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/arrays/arrow/array.py", line 2221, in __setitem__
    value = self._maybe_convert_setitem_value(value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.11.14/x64/lib/python3.11/site-packages/pandas/core/arrays/string_arrow.py", line 293, in _maybe_convert_setitem_value
    raise TypeError(
TypeError: Invalid value for dtype 'str'. Value should be a string or missing value (or array of those).
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsmall thing/optimizationMinor change or marginal benefit (but would be nice)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions