AlexsLemonade / AlexsLemonade/refinebio-py

Bug: pyrate_limiter `RequestRate` is now `Rate`

Open
#90 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## Bug report

Recently had to update a container that has `pyrefinebio` on it. It is no longer able to import because of problem with `pyrate_limiter` change.

I found this on a Github action where the error is occurring. I did reproduce this same error locally as well.

https://github.com/jhudsl/reproducible-R-example/actions/runs/13310400207/job/37171249562

## To reproduce:

This is all my script has at the top
```
import os
from pathlib import Path
import pyrefinebio
```
This is the error:
```
Traceback (most recent call last):
File "/home/rstudio/00-download-data.py", line 8, in
import pyrefinebio
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/__init__.py", line 1, in
from pyrefinebio.compendia import Compendium
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/compendia.py", line 3, in
from pyrefinebio import computed_file as prb_computed_file
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/computed_file.py", line 3, in
from pyrefinebio import computational_result as prb_computational_result, sample as prb_sample
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/computational_result.py", line 1, in
from pyrefinebio import (
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/annotation.py", line 3, in
from pyrefinebio.util import parse_date
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/util.py", line 4, in
from pyrefinebio.api_interface import get
File "/usr/local/lib/python3.12/dist-packages/pyrefinebio/api_interface.py", line 5, in
from pyrate_limiter import Duration, Limiter, RequestRate
ImportError: cannot import name 'RequestRate' from 'pyrate_limiter' (/usr/local/lib/python3.12/dist-packages/pyrate_limiter/__init__.py)
```

## Reccommmended solution

Ah looked in the docs for pyRateLimiter. They changed the name of the `RequestRate` module to `Rate` https://github.com/vutran1710/PyrateLimiter/commit/41feda05c872f784e4d9e2cbf70cbde94699c18f#diff-ea643561f5c6bb72672757029b85694f3d95c7fa27cf232e4d43151ae3712134R65

I will try to file a PR for this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in pyrefinebio/api_interface.py, where the traceback shows the pyrate_limiter import failing. Use the provided minimal import script or the linked GitHub Actions run to reproduce the error. Done means importing pyrefinebio succeeds with the current pyrate_limiter API.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.