fix(market): priced flag on securities (symbol records never priced), ELV PFS link from its 10-K, CI unpriced
Some checks failed
CI / lint (push) Successful in 1m53s
CI / notebooks-smoke (push) Successful in 2m15s
Deploy / changes (push) Successful in 20s
CI / test (push) Failing after 6m52s
Infra CI / zotero (push) Successful in 2m26s
Infra CI / notebooks (push) Successful in 4m17s
Infra CI / api (push) Successful in 1m46s
Infra CI / docs (push) Successful in 2m22s
Infra CI / llm (push) Successful in 1m34s
Infra CI / mc (push) Successful in 1m7s
Deploy / notebooks (push) Has been skipped
Infra CI / bcda (push) Successful in 2m50s
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Deploy / api (push) Successful in 2m42s
Deploy / bcda (push) Successful in 3m39s
Deploy / mc (push) Has been skipped
Deploy / llm (push) Successful in 2m3s
Deploy / report (push) Successful in 19s
Some checks failed
CI / lint (push) Successful in 1m53s
CI / notebooks-smoke (push) Successful in 2m15s
Deploy / changes (push) Successful in 20s
CI / test (push) Failing after 6m52s
Infra CI / zotero (push) Successful in 2m26s
Infra CI / notebooks (push) Successful in 4m17s
Infra CI / api (push) Successful in 1m46s
Infra CI / docs (push) Successful in 2m22s
Infra CI / llm (push) Successful in 1m34s
Infra CI / mc (push) Successful in 1m7s
Deploy / notebooks (push) Has been skipped
Infra CI / bcda (push) Successful in 2m50s
Deploy / zotero (push) Has been skipped
Deploy / docs (push) Has been skipped
Deploy / api (push) Successful in 2m42s
Deploy / bcda (push) Successful in 3m39s
Deploy / mc (push) Has been skipped
Deploy / llm (push) Successful in 2m3s
Deploy / report (push) Successful in 19s
This commit is contained in:
@@ -188,7 +188,9 @@ def securities_for(
|
||||
that the seed does not."""
|
||||
cik = cik10(sub.get("cik") or (seed.cik if seed else "0"))
|
||||
out = [
|
||||
SecurityRow(cik, s.ticker, s.exchange, s.valid_from, s.valid_to, "seed")
|
||||
SecurityRow(
|
||||
cik, s.ticker, s.exchange, s.valid_from, s.valid_to, "seed", s.priced
|
||||
)
|
||||
for s in (seed.securities if seed else ())
|
||||
]
|
||||
have = {s.ticker for s in out}
|
||||
|
||||
@@ -71,6 +71,10 @@ class SeedSecurity:
|
||||
cite: Cite | None = None
|
||||
#: the filing that dates ``valid_to`` (a merger or delisting 8-K, ...)
|
||||
cite_to: Cite | None = None
|
||||
#: ``False`` for a symbol record the price provider does not carry under
|
||||
#: that ticker (a prior symbol of the same company, or a company the seed
|
||||
#: could not link to a CMS program): never sent for prices
|
||||
priced: bool = True
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -180,6 +184,7 @@ def _company(raw: Mapping[str, Any]) -> SeedCompany:
|
||||
_cite(s["cite_to"], f"{handle}/{s['ticker']}")
|
||||
if s.get("cite_to")
|
||||
else None,
|
||||
bool(s.get("priced", True)),
|
||||
)
|
||||
for s in raw.get("securities") or ()
|
||||
),
|
||||
|
||||
@@ -176,8 +176,8 @@ companies:
|
||||
status: listed
|
||||
aliases: ["PEDIATRIX MEDICAL GROUP", "MEDNAX"]
|
||||
securities:
|
||||
- {ticker: PDX, exchange: NYSE, valid_to: 2008-12-31, cite: {adsh: "0001193125-08-040809", title: "Pediatrix Medical Group, Inc. Form 10-K filed 2008-02-28", quote: "OF EQUITY SECURITIES Price Range of Common Stock Our common stock is traded on the New York Stock Exchange (the \"NYSE\") under the symbol \"PDX.\" The high and low sales price for a share of our common stock for each quarter during our last two fiscal years is set forth below, as reported in the NYSE consolidated transaction reporting system: High Low 2007 First Quarter $ 57.41 $", accessed: "2026-11-12"}, cite_to: {adsh: "0001193125-09-000041", title: "Pediatrix Medical Group, Inc. Form 8-K12B filed 2009-01-02", quote: "The Mednax Common Stock will trade on the New York Stock Exchange under the \"MD\" ticker symbol in place of the Pediatrix Common Stock. In connection with the Merger, Mednax entered into an Assignment and Joinder Agreement, dated as of January 1, 2009", accessed: "2026-11-12"}}
|
||||
- {ticker: MD, exchange: NYSE, valid_from: 2009-01-01, cite: {adsh: "0001193125-09-000041", title: "Pediatrix Medical Group, Inc. Form 8-K12B filed 2009-01-02", quote: "The Mednax Common Stock will trade on the New York Stock Exchange under the \"MD\" ticker symbol in place of the Pediatrix Common Stock. In connection with the Merger, Mednax entered into an Assignment and Joinder Agreement, dated as of January 1, 2009", accessed: "2026-11-12"}}
|
||||
- {ticker: PDX, exchange: NYSE, valid_to: 2008-12-31, priced: false, cite: {adsh: "0001193125-08-040809", title: "Pediatrix Medical Group, Inc. Form 10-K filed 2008-02-28", quote: "OF EQUITY SECURITIES Price Range of Common Stock Our common stock is traded on the New York Stock Exchange (the \"NYSE\") under the symbol \"PDX.\" The high and low sales price for a share of our common stock for each quarter during our last two fiscal years is set forth below, as reported in the NYSE consolidated transaction reporting system: High Low 2007 First Quarter $ 57.41 $", accessed: "2026-11-12"}, cite_to: {adsh: "0001193125-09-000041", title: "Pediatrix Medical Group, Inc. Form 8-K12B filed 2009-01-02", quote: "The Mednax Common Stock will trade on the New York Stock Exchange under the \"MD\" ticker symbol in place of the Pediatrix Common Stock. In connection with the Merger, Mednax entered into an Assignment and Joinder Agreement, dated as of January 1, 2009", accessed: "2026-11-12"}}
|
||||
- {ticker: MD, exchange: NYSE, cite: {adsh: "0001193125-09-000041", title: "Pediatrix Medical Group, Inc. Form 8-K12B filed 2009-01-02", quote: "The Mednax Common Stock will trade on the New York Stock Exchange under the \"MD\" ticker symbol in place of the Pediatrix Common Stock. In connection with the Merger, Mednax entered into an Assignment and Joinder Agreement, dated as of January 1, 2009", accessed: "2026-11-12"}}
|
||||
cite: {adsh: "0001193125-26-058074", title: "Pediatrix Medical Group, Inc. Form 10-K filed 2026-02-19", quote: "For instance, the 2024 Medicare Physician Fee Schedule Final Rule decreased the 2024 conversion factor (i.e., the amount Medicare pays per relative value unit (wRVU)) by nearly 3.4% from the 2023 amount.", accessed: "2026-11-12"}
|
||||
links:
|
||||
- {scope: program, target: "PFS", cite: {adsh: "0001193125-26-058074", title: "Pediatrix Medical Group, Inc. Form 10-K filed 2026-02-19", quote: "For instance, the 2024 Medicare Physician Fee Schedule Final Rule decreased the 2024 conversion factor (i.e., the amount Medicare pays per relative value unit (wRVU)) by nearly 3.4% from the 2023 amount.", accessed: "2026-11-12"}}
|
||||
@@ -264,7 +264,7 @@ companies:
|
||||
status: listed
|
||||
aliases: ["CIGNA GROUP", "CIGNA", "EVERNORTH"]
|
||||
securities:
|
||||
- {ticker: CI, exchange: NYSE, valid_from: 2018-12-21, cite: {adsh: "0001140361-18-045479", title: "Cigna Group Form 8-K12B filed 2018-12-20", quote: "Cigna common stock will cease trading on the New York Stock Exchange (the \"NYSE\") and Express Scripts common stock will cease trading on the Nasdaq Global Select Market, in each case prior to the open of trading on December 21, 2018, and New Cigna common stock will commence trading on the NYSE on December 21, 2018 under the symbol \"CI\".", accessed: "2026-11-12"}}
|
||||
- {ticker: CI, exchange: NYSE, valid_from: 2018-12-21, priced: false, cite: {adsh: "0001140361-18-045479", title: "Cigna Group Form 8-K12B filed 2018-12-20", quote: "Cigna common stock will cease trading on the New York Stock Exchange (the \"NYSE\") and Express Scripts common stock will cease trading on the Nasdaq Global Select Market, in each case prior to the open of trading on December 21, 2018, and New Cigna common stock will commence trading on the NYSE on December 21, 2018 under the symbol \"CI\".", accessed: "2026-11-12"}}
|
||||
cite: {adsh: "0001739940-26-000006", title: "Cigna Group Form 10-K filed 2026-02-26", quote: "The Evernorth Health Services segment, through our Pharmacy Benefit Services and Specialty and Care Services operating segments, provides independent and coordinated health solutions and capabilities to enable the health care system to work better and help people live healthier lives.", accessed: "2026-11-12"}
|
||||
links:
|
||||
- handle: ELV
|
||||
@@ -273,10 +273,11 @@ companies:
|
||||
status: listed
|
||||
aliases: ["ELEVANCE HEALTH", "ANTHEM", "CARELON"]
|
||||
securities:
|
||||
- {ticker: ANTM, exchange: NYSE, valid_to: 2022-06-27, cite: {adsh: "0001193125-22-165676", title: "Elevance Health, Inc. Form 8-K filed 2022-06-02", quote: "registered pursuant to Section 12(b) of the Act: Title of each class Trading Symbol(s) Name of each exchange on which registered Common Stock ANTM NYSE Indicate by check mark whether the registrant is an emerging growth company as defined in Rule 405 of the Securities Act of 1933 (§230.405 of this chapter) or Rule 12b-2 of the Securities Exchange Act of 1934 (§240.12b-2 of this", accessed: "2026-11-12"}, cite_to: {adsh: "0001156039-22-000081", title: "Elevance Health, Inc. Form 10-Q filed 2022-07-20", quote: "We began operating as Elevance Health, Inc. and trading under our new ticker symbol \"ELV\" on June 28, 2022.", accessed: "2026-11-12"}}
|
||||
- {ticker: ELV, exchange: NYSE, valid_from: 2022-06-28, cite: {adsh: "0001156039-22-000081", title: "Elevance Health, Inc. Form 10-Q filed 2022-07-20", quote: "We began operating as Elevance Health, Inc. and trading under our new ticker symbol \"ELV\" on June 28, 2022.", accessed: "2026-11-12"}}
|
||||
- {ticker: ANTM, exchange: NYSE, valid_to: 2022-06-27, priced: false, cite: {adsh: "0001193125-22-165676", title: "Elevance Health, Inc. Form 8-K filed 2022-06-02", quote: "registered pursuant to Section 12(b) of the Act: Title of each class Trading Symbol(s) Name of each exchange on which registered Common Stock ANTM NYSE Indicate by check mark whether the registrant is an emerging growth company as defined in Rule 405 of the Securities Act of 1933 (§230.405 of this chapter) or Rule 12b-2 of the Securities Exchange Act of 1934 (§240.12b-2 of this", accessed: "2026-11-12"}, cite_to: {adsh: "0001156039-22-000081", title: "Elevance Health, Inc. Form 10-Q filed 2022-07-20", quote: "We began operating as Elevance Health, Inc. and trading under our new ticker symbol \"ELV\" on June 28, 2022.", accessed: "2026-11-12"}}
|
||||
- {ticker: ELV, exchange: NYSE, cite: {adsh: "0001156039-22-000081", title: "Elevance Health, Inc. Form 10-Q filed 2022-07-20", quote: "We began operating as Elevance Health, Inc. and trading under our new ticker symbol \"ELV\" on June 28, 2022.", accessed: "2026-11-12"}}
|
||||
cite: {adsh: "0001156039-26-000013", title: "Elevance Health, Inc. Form 10-K filed 2026-02-06", quote: "In addition, we provide a broad array of managed care services to fee-based customers, including claims processing, stop loss insurance, care provider network access, medical management, care management, wellness programs, actuarial services and other administrative services.", accessed: "2026-11-12"}
|
||||
links:
|
||||
- {scope: program, target: "PFS", cite: {adsh: "0001156039-26-000013", title: "Elevance Health, Inc. Form 10-K filed 2026-02-06", quote: "fee schedules are developed at the state level based on an assessment of several factors and conditions, including the CMS resource-based relative value scale system (\"RBRVS\"), medical practice cost inflation and physician supply of each specialty. We utilize CMS RBRVS fee schedules as a reference point for fee schedule development and analysis", accessed: "2026-11-12"}}
|
||||
- handle: LH
|
||||
name: "LABCORP HOLDINGS INC."
|
||||
cik: "0000920148"
|
||||
|
||||
@@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS market.entity (
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS market.security (
|
||||
entity_key VARCHAR, ticker VARCHAR, exchange VARCHAR,
|
||||
valid_from DATE, valid_to DATE, source VARCHAR
|
||||
valid_from DATE, valid_to DATE, source VARCHAR, priced BOOLEAN DEFAULT TRUE
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS market.entity_link (
|
||||
entity_key VARCHAR, scope VARCHAR, target VARCHAR, basis VARCHAR,
|
||||
@@ -45,6 +45,9 @@ def ensure_tables(con: Any) -> None:
|
||||
con.execute(stmt)
|
||||
# a market.entity created before the pseudo flag existed
|
||||
con.execute("ALTER TABLE market.entity ADD COLUMN IF NOT EXISTS pseudo BOOLEAN")
|
||||
con.execute(
|
||||
"ALTER TABLE market.security ADD COLUMN IF NOT EXISTS priced BOOLEAN DEFAULT TRUE"
|
||||
)
|
||||
# a market.entity_link created before links carried dates
|
||||
for col in ("valid_from", "valid_to"):
|
||||
con.execute(
|
||||
@@ -81,6 +84,9 @@ class SecurityRow:
|
||||
valid_from: date | None
|
||||
valid_to: date | None
|
||||
source: str
|
||||
#: ``False``: a historical symbol record, never sent for prices and not
|
||||
#: counted against the price-provider symbol cap
|
||||
priced: bool = True
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -215,7 +221,7 @@ def read_securities(con: Any, entity_key: str | None = None) -> list[SecurityRow
|
||||
[entity_key] if entity_key else [],
|
||||
)
|
||||
return sorted(
|
||||
(SecurityRow(*r) for r in rows),
|
||||
(SecurityRow(*r[:-1], priced=r[-1] is not False) for r in rows),
|
||||
key=lambda s: (s.entity_key, s.ticker, s.valid_from or dt.date.min),
|
||||
)
|
||||
|
||||
|
||||
@@ -577,10 +577,10 @@ def test_entities_stores_ticker_history_and_link_dates(env):
|
||||
runner.invoke(app, ["market", "entities", "--offline", "--write"]).exit_code
|
||||
== 0
|
||||
)
|
||||
assert [(s.ticker, s.valid_to) for s in T.read_securities(c, "0001156039")] == [
|
||||
("ANTM", date(2022, 6, 27)),
|
||||
("ELV", None),
|
||||
]
|
||||
assert [
|
||||
(s.ticker, s.valid_to, s.priced) for s in T.read_securities(c, "0001156039")
|
||||
] == [("ANTM", date(2022, 6, 27), False), ("ELV", None, True)]
|
||||
assert [s.priced for s in T.read_securities(c, "0001739940")] == [False]
|
||||
(clov,) = [
|
||||
l
|
||||
for l in T.read_links(c, basis="curated", target="APM")
|
||||
|
||||
@@ -465,10 +465,12 @@ def test_same_cik_rename_gives_one_security_row_per_ticker():
|
||||
elv = next(c for c in companies if c.handle == "ELV")
|
||||
sub = {"cik": elv.cik, "tickers": ["ELV"], "exchanges": ["NYSE"]}
|
||||
secs = edgar.securities_for(sub, elv, ["ELV"])
|
||||
assert [(s.ticker, s.valid_from, s.valid_to, s.source) for s in secs] == [
|
||||
("ANTM", None, date(2022, 6, 27), "seed"),
|
||||
("ELV", date(2022, 6, 28), None, "seed"),
|
||||
assert [(s.ticker, s.valid_from, s.valid_to, s.source, s.priced) for s in secs] == [
|
||||
("ANTM", None, date(2022, 6, 27), "seed", False),
|
||||
("ELV", None, None, "seed", True),
|
||||
]
|
||||
sec_only = edgar.securities_for({"cik": "7", "tickers": ["NEW"]}, None, [])
|
||||
assert [s.priced for s in sec_only] == [True]
|
||||
|
||||
|
||||
def test_ama_index_is_built_once_and_matches_like_the_list_form():
|
||||
|
||||
@@ -316,7 +316,7 @@ def test_shipped_ticker_windows_come_from_filing_evidence():
|
||||
(ci,) = by["CI"].securities
|
||||
assert ci.valid_from == date(2018, 12, 21) and ci.cite.adsh
|
||||
md = by["MD"].securities[-1]
|
||||
assert md.ticker == "MD" and md.cite.adsh and md.valid_from is not None
|
||||
assert md.ticker == "MD" and md.cite.adsh
|
||||
|
||||
|
||||
def _by():
|
||||
@@ -324,10 +324,13 @@ def _by():
|
||||
return {c.handle: c for c in companies}
|
||||
|
||||
|
||||
def test_payers_without_a_cms_program_quote_have_no_care_management_link():
|
||||
def test_elv_links_to_the_pfs_through_its_own_10k_and_ci_is_unpriced():
|
||||
by = _by()
|
||||
for h in ("CI", "ELV"):
|
||||
assert by[h].links == () and by[h].cite.quote
|
||||
(pfs,) = by["ELV"].links
|
||||
assert (pfs.scope, pfs.target) == ("program", "PFS")
|
||||
assert "RBRVS" in pfs.cite.quote and "fee schedule" in pfs.cite.quote
|
||||
assert by["CI"].links == () and by["CI"].cite.quote
|
||||
assert [s.priced for s in by["CI"].securities] == [False]
|
||||
|
||||
|
||||
def test_link_dates_come_from_the_cited_filing():
|
||||
@@ -348,20 +351,18 @@ def test_same_cik_ticker_renames_are_a_history_not_a_clip():
|
||||
None,
|
||||
date(2022, 6, 27),
|
||||
)
|
||||
assert (elv.ticker, elv.valid_from, elv.valid_to) == (
|
||||
"ELV",
|
||||
date(2022, 6, 28),
|
||||
None,
|
||||
)
|
||||
assert (elv.ticker, elv.valid_from, elv.valid_to) == ("ELV", None, None)
|
||||
assert antm.cite.adsh and antm.cite_to.adsh == elv.cite.adsh
|
||||
assert (antm.priced, elv.priced) == (False, True)
|
||||
pdx, md = by["MD"].securities
|
||||
assert (pdx.ticker, pdx.valid_from, pdx.valid_to) == (
|
||||
"PDX",
|
||||
None,
|
||||
date(2008, 12, 31),
|
||||
)
|
||||
assert (md.ticker, md.valid_from) == ("MD", date(2009, 1, 1))
|
||||
assert (md.ticker, md.valid_from, md.valid_to) == ("MD", None, None)
|
||||
assert pdx.cite.quote and pdx.cite_to.adsh == md.cite.adsh
|
||||
assert (pdx.priced, md.priced) == (False, True)
|
||||
|
||||
|
||||
def test_ticker_recycled_across_ciks_stays_clipped():
|
||||
@@ -372,3 +373,20 @@ def test_ticker_recycled_across_ciks_stays_clipped():
|
||||
date(2018, 12, 21),
|
||||
None,
|
||||
)
|
||||
|
||||
|
||||
def test_priced_flag_parses_and_defaults_true(tmp_path):
|
||||
body = COMPANY.format(
|
||||
extra='cite: {url: "u"}\n securities:\n - {ticker: A, exchange: X}\n'
|
||||
" - {ticker: B, exchange: X, priced: false}"
|
||||
)
|
||||
companies, _ = S.load_seed(_write(tmp_path, body))
|
||||
assert [s.priced for s in companies[0].securities] == [True, False]
|
||||
|
||||
|
||||
def test_only_symbol_records_are_unpriced():
|
||||
companies, _ = S.load_seed()
|
||||
unpriced = {
|
||||
(c.handle, s.ticker) for c in companies for s in c.securities if not s.priced
|
||||
}
|
||||
assert unpriced == {("ELV", "ANTM"), ("MD", "PDX"), ("CI", "CI")}
|
||||
|
||||
@@ -288,3 +288,28 @@ def test_ensure_tables_adds_dates_to_an_existing_link_table():
|
||||
(old,) = T.read_links(c)
|
||||
assert old.valid_from is None and old.valid_to is None
|
||||
c.close()
|
||||
|
||||
|
||||
def test_security_priced_flag_roundtrips_and_old_rows_read_as_priced(con):
|
||||
sym = T.SecurityRow("1", "ANTM", "NYSE", None, date(2022, 6, 27), "seed", False)
|
||||
T.write_securities(
|
||||
con, "1", [sym, T.SecurityRow("1", "ELV", "NYSE", None, None, "seed")]
|
||||
)
|
||||
assert [(s.ticker, s.priced) for s in T.read_securities(con, "1")] == [
|
||||
("ANTM", False),
|
||||
("ELV", True),
|
||||
]
|
||||
|
||||
|
||||
def test_ensure_tables_adds_priced_to_an_existing_security_table():
|
||||
c = duckdb.connect(":memory:")
|
||||
c.execute("CREATE SCHEMA market")
|
||||
c.execute(
|
||||
"CREATE TABLE market.security (entity_key VARCHAR, ticker VARCHAR, exchange VARCHAR, "
|
||||
"valid_from DATE, valid_to DATE, source VARCHAR)"
|
||||
)
|
||||
c.execute("INSERT INTO market.security VALUES ('1','OLD','NYSE',NULL,NULL,'sec')")
|
||||
T.ensure_tables(c)
|
||||
(old,) = T.read_securities(c)
|
||||
assert old.priced is True
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user