Repository navigation
clean up nyse symbols in stock.yml (#1928) - #1932
Conversation
ok so the symbol_nyse list had a bunch of weird stuff in it, like
preferred shares with ^ (JPM^A), warrants (JPM.WS), stuff like OSG$
and some tickers padded with a ton of trailing spaces lol. removed
all of those so its just plain tickers now
also checked the rest against the current nasdaq trader symbol
directory (otherlisted.txt, exchange N) and dropped the ones that
arent on nyse anymore (NVTA, IRET, STAR, JAX, IO etc, plus some that
moved to nasdaq like AXON). went from 3167 -> 1409 entries
the regex in the test was kinda broken too ([A-Z.-^$` ] basically
matches everything bc of the .-^ range) so i changed it to
[A-Z]{1,4} and added a test that checks the whole list instead of
just 10 random ones
Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Summary
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1932 +/- ##
============================================
- Coverage 92.36% 92.31% -0.06%
+ Complexity 3559 3557 -2
============================================
Files 348 348
Lines 7051 7051
Branches 691 691
============================================
- Hits 6513 6509 -4
- Misses 371 373 +2
- Partials 167 169 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
asolntsev
left a comment
There was a problem hiding this comment.
Thanks for cleaning this up! I checked the new symbol_nyse list against NASDAQ Trader's otherlisted.txt (Exchange=N): all 1409 entries are currently NYSE-listed, and no duplicates or padding remain. A few points below.
Also: the same padding bug as #1928 is still in symbol_nsdq (e.g. "BLIN ", "ENZY ", "IMNP ", "TORM "). The nsdqSymbol test regex [A-Z. -]+ allows spaces, so it goes unnoticed. It would be worth trimming and adding a whole-list check for every symbol_* list.
| @@ -4,321 +4,147 @@ en: | |||
| symbol_nyse: | |||
There was a problem hiding this comment.
The "letters only" filter also drops real NYSE common-stock class tickers: BRK.A, BRK.B, BF.A, BF.B are listed in otherlisted.txt as common stock on NYSE. After this change nyseSymbol() can never return Berkshire Hathaway. Could we exclude only preferred shares and warrants (^, /, $, .WS) and keep the class shares?
Smaller points about this list:
HFandTPZare ETFs (ETF=Y inotherlisted.txt). If the list is meant to be stocks only, also filter on the ETF column.- A comment noting the source (
otherlisted.txt, Exchange=N) and the snapshot date would make the next refresh easier. - The list goes from about 2657 to 1409 distinct tickers, so
unique()users run out sooner and seeded outputs change. Probably worth a changelog note.
| void nyseSymbolsArePlainTickers() { | ||
| assertThat(getBaseList(faker, "stock.symbol_nyse")) | ||
| .doesNotHaveDuplicates() | ||
| .allMatch(symbol -> symbol.matches("[A-Z]{1,4}")); |
There was a problem hiding this comment.
[A-Z]{1,4} is stricter than the real NYSE format and rejects BRK.B / BF.B. How about [A-Z]{1,4}(\\.[A-Z])?? It still blocks ^, /, $ and .WS.
| } | ||
|
|
||
| @Test | ||
| void nyseSymbolsArePlainTickers() { |
There was a problem hiding this comment.
AbstractProviderListTest already supports a per-key regex: TestSpec.of(stock::nyseSymbol, "stock.symbol_nyse", "<regex>") in providerListTest() would replace this method and the extra Test import.
| @RepeatedTest(10) | ||
| void nyseTicker() { | ||
| assertThat(faker.stock().nyseSymbol()).matches("[A-Z.-^$` ]+"); | ||
| assertThat(faker.stock().nyseSymbol()).matches("[A-Z]{1,4}"); |
There was a problem hiding this comment.
Now that every entry is checked against the same regex, this @RepeatedTest(10) adds no coverage. It could be dropped, which also leaves the regex in one place.
|
Merged and followed-up by #1944 |
… stock lists * restore 22 NYSE class shares still listed as common stock (BRK.A, BRK.B, BF.A, BF.B, ...) * remove ETFs HF and TPZ from symbol_nyse * trim padded entries in symbol_nsdq (BLIN, ENZY, IMNP, TORM) * AbstractProviderListTest: validate every list entry against the TestSpec regex * StockTest: per-list regexes in providerListTest(), no-duplicates check, drop redundant repeated tests * document data source of nyseSymbol() and add a release note Co-Authored-By: Claude Opus 5.5 <[email protected]>
Fixes #1928
The symbol_nyse list had a bunch of weird stuff in it, like preferred shares with ^ (JPM^A), warrants (JPM.WS), stuff like OSG$ and some tickers padded with a ton of trailing spaces. I removed all of those so its just plain tickers now.
also checked the rest against the current nasdaq trader symbol directory (otherlisted.txt, exchange N) and dropped the ones that arent on nyse anymore (NVTA, IRET, STAR, JAX, IO etc, plus some that moved to nasdaq like AXON). went from 3167 -> 1409 entries
the regex in the test was kinda broken too ([A-Z.-^$` ] basically matches everything bc of the .-^ range) so i changed it to [A-Z]{1,4} and added a test that checks the whole list instead of just 10 random ones