Skip to content

Normalize TQQQ benchmark close history#55

Merged
Pigbibi merged 1 commit into
mainfrom
fix/tqqq-benchmark-close-normalization
May 15, 2026
Merged

Normalize TQQQ benchmark close history#55
Pigbibi merged 1 commit into
mainfrom
fix/tqqq-benchmark-close-normalization

Conversation

@Pigbibi
Copy link
Copy Markdown
Contributor

@Pigbibi Pigbibi commented May 15, 2026

Summary\n- normalize benchmark history input for tqqq_growth_income\n- accept DataFrame/Series/list inputs and case-insensitive close columns\n- raise a clear ValueError when close history is genuinely missing\n\n## Validation\n- pytest tests/test_strategy_plans.py -q -k 'tqqq_growth_income'\n- py_compile on modified files

@Pigbibi Pigbibi merged commit 29b15d3 into main May 15, 2026
1 check passed
@Pigbibi Pigbibi deleted the fix/tqqq-benchmark-close-normalization branch May 15, 2026 14:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbe63d6618

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

elif isinstance(history, pd.Series):
frame = history.to_frame(name="close")
else:
frame = pd.DataFrame(list(history))
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve mapping-shaped benchmark history inputs

Converting non-DataFrame/Series inputs via pd.DataFrame(list(history)) breaks valid mapping-shaped payloads (for example {"close": [...], "high": [...], "low": [...]}) that previously worked with pd.DataFrame(qqq_history). For mappings, list(history) yields only keys, so normalization later coerces strings to NaN and raises a ValueError, causing runtime failures for callers/adapters that provide benchmark history as a dict-of-arrays.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant