fix(codegen): parse 'YYYY-MM-DD HH:MM UTC' timestamps + accept ignore_invalid_symbol#44
Merged
luisleo526 merged 1 commit intoJul 7, 2026
Conversation
…_invalid_symbol
Two additive transpile fixes that unblock valid community Pine (each recovered a
data/ strategy from transpile-error to EXCELLENT, 100% match / cntAbs 0):
1. timestamp(dateString): _parse_pine_datestring_ms couldn't read a trailing tz
WORD ("2024-01-01 00:00 UTC", "1 Jan 2020 09:30 GMT+2") or the space-separated
"YYYY-MM-DD HH:MM[:SS]" form. Peel the UTC/GMT[±H[:MM]] word into an explicit
offset and add the Y-M-D strptime formats. Purely additive — strings that
already parsed are unchanged (the regex is a no-op without a trailing tz word).
Recovers yukozb-gold-ny-orb.
2. request.security ignore_invalid_symbol: was hard-rejected ("reject loudly"),
but it is a GUARANTEED no-op here — codegen forces request.security onto the
current chart symbol (the "symbol must reference current chart symbol" check),
which is always valid, so the flag can never change the result. Move it into
SECURITY_ALLOWED_PARAMS (accept + drop), alongside backadjustment/adjustment.
`currency` stays hard-rejected (it changes values via FX conversion). Recovers
officialjack-helios.
Also fixes a pre-existing stale KI-35 assertion in test_compile_smoke.py
(test_regression_year_function_call_form_compiles asserted the old gmtime_r inline
lambda; year()/hour() now lower to pine_<field>() engine helpers — PR #42 leftover
that PR #43 missed).
Tests: new timestamp UTC/GMT-word cases; ignore_invalid_symbol now asserted
accepted; locked-params snapshot updated. Full suite green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two additive transpile fixes that unblock valid community Pine. Each recovered a data/ strategy from transpile-error → excellent (100% match, cntAbs 0).
Fixes
timestamp(dateString):_parse_pine_datestring_mscouldn't read a trailing tz word ("2024-01-01 00:00 UTC","1 Jan 2020 09:30 GMT+2") or the space-separatedYYYY-MM-DD HH:MM[:SS]form. Peel theUTC/GMT[±H[:MM]]word into an explicit offset + add the Y-M-D strptime formats. Purely additive — strings that already parsed are unchanged. → recovers yukozb-gold-ny-orb.request.security ignore_invalid_symbol: was hard-rejected, but it's a guaranteed no-op — codegen forces request.security onto the current chart symbol (always valid), so the flag can never change the result. Moved intoSECURITY_ALLOWED_PARAMS(accept + drop).currencystays rejected (FX-changing). → recovers officialjack-helios.Also fixes a pre-existing stale KI-35 assertion in
test_compile_smoke.py(year() now lowers topine_*helpers, not the oldgmtime_rlambda — a #42/#43 leftover).Verification (fresh-context R7 = GO)
ignore_invalid_symbol, 0timestamp(, so the new paths are untouched).🤖 Generated with Claude Code