Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

test: the A-share floor sweep does not catch a restored flat constant

Open Beginner friendly
#482 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

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

Research direction

Read dashboard/backend/tests/infrastructure/market_data/test_ifind_ashare.py:511-539 and the floor calculation it exercises. Update the sweep to include a short legal window, such as one with three weekdays, where a restored flat value of 40 exceeds the reachable 12 bars. Run the test and verify it fails when the implementation is temporarily changed to return 40.

Written by the indexing model from the issue text.

Description

bug good issue

Follow-up from #474 item 1 (PR #477).

test_minimum_bars_never_exceeds_what_any_legal_window_can_actually_return (dashboard/backend/tests/infrastructure/market_data/test_ifind_ashare.py:511-539) sweeps all seven start weekdays and asserts floor <= weekdays * 4. Its docstring claims it "fails loudly if someone raises _MINIMUM_BAR_COMPLETENESS above 1.0 or restores a flat constant".

It does the first. It does not do the second:

  • floor = max(4, int(weekdays * 4 * completeness)), so the assertion reduces to completeness <= 1.0 — true for any value at or below 1.
  • A restored flat 40 passes every case in the sweep. A 14-day window holds at most 10 weekdays, 10 × 4 = 40, and 40 <= 40 holds. That is exactly the constant the change was made to remove, and it comes back green.

Fix shape: assert against a window the flat constant would break rather than against the widest one. A short legal window (say 3 weekdays → 12 reachable bars) separates a proportional floor from any flat value above 12. Mutation-check the new test by restoring return 40.

Dominant language
Python
Stars
767
Forks
156
Avg merge
21h 57m
Merged PRs (30d)
92

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Open-Finance-Lab/AgenticTrading

All issues in Open-Finance-Lab/AgenticTrading

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.