Skip to content

Commit

Permalink
fix: correct type comparison in IndicatorRegistry.available_indicators
Browse files Browse the repository at this point in the history
Fix type comparison issue in the available_indicators property of IndicatorRegistry class.
Ensure all keys are converted to strings before sorting to avoid TypeError when
comparing method and str types.

- Add explicit string conversion in available_indicators property
- Fix type error in unit tests
  • Loading branch information
Xuan Ronaldo committed Dec 11, 2024
1 parent 9d3b2df commit f116481
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.7",
python_requires=">=3.10",
install_requires=[
"polars>=0.20.0",
"pandas>=2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/positionbt/indicators/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def available_indicators(self) -> list[str]:
Sorted list of registered indicator names
"""
return sorted(self._indicators.keys())
return sorted(str(key) for key in self._indicators.keys())

@property
def sorted_indicators(self) -> dict[str, type[BaseIndicator]]:
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit f116481

Please sign in to comment.