Update the earnings calendar
Browse files- PIPELINE.md +5 -0
- README.md +6 -0
- data/announcements/part-00000.parquet +2 -2
- data/earnings/part-00000.parquet +2 -2
- data/events/part-00000.parquet +2 -2
- data/events/part-00001.parquet +2 -2
- data/events/part-00002.parquet +2 -2
- data/pit/earnings_calendar.delta/_delta_log/00000000000000000000.json +3 -3
- data/pit/earnings_calendar.delta/{part-00000-78a686b7-f3d4-419e-b99c-f7d034d60a9d-c000.snappy.parquet → part-00000-a7ad72ab-857a-476e-a356-02d31ef3eef8-c000.snappy.parquet} +2 -2
- data/pit/part-00000.parquet +2 -2
- manifest.json +4 -2
- recipe/build.py +1 -0
- recipe/earnings.py +2 -1
- recipe/schema.py +6 -0
- tests/test_docs_and_jobs.py +15 -0
PIPELINE.md
CHANGED
|
@@ -174,6 +174,11 @@ instant is used for those — 23.1% of rows — and every other event is dated t
|
|
| 174 |
early, which is the direction a knowledge date may be wrong in.
|
| 175 |
`knowledge_estimated` marks which is which.
|
| 176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
One consequence is visible in the data and is not an error: 63 065 events carry
|
| 178 |
an exact timestamp earlier than their own filing date, because EDGAR stamps
|
| 179 |
anything accepted after 17:30 with the next business day. The quality gate
|
|
|
|
| 174 |
early, which is the direction a knowledge date may be wrong in.
|
| 175 |
`knowledge_estimated` marks which is which.
|
| 176 |
|
| 177 |
+
The same convention decided a smaller thing: `announcements` and `earnings`
|
| 178 |
+
carry `knowledge_date` as well, as an alias of the acceptance instant they
|
| 179 |
+
already published under `announced_at`. Verified against the adapter itself --
|
| 180 |
+
before the alias it resolved two configs of four, now it resolves all four.
|
| 181 |
+
|
| 182 |
One consequence is visible in the data and is not an error: 63 065 events carry
|
| 183 |
an exact timestamp earlier than their own filing date, because EDGAR stamps
|
| 184 |
anything accepted after 17:30 with the next business day. The quality gate
|
README.md
CHANGED
|
@@ -217,6 +217,12 @@ date: EDGAR stamps anything accepted after 17:30 with the next business day.)
|
|
| 217 |
| `events` | 4 382 182 | one 8-K item: a dated corporate event of any kind |
|
| 218 |
| `pit` | 258 482 | one point-in-time earnings knowledge event, plus a Delta table |
|
| 219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 220 |
`entity_id` in `pit` is the issuer CIK, the same key as every sibling dataset,
|
| 221 |
so an earnings date joins directly to
|
| 222 |
[company-fundamentals](https://huggingface.co/datasets/ZipLime/company-fundamentals),
|
|
|
|
| 217 |
| `events` | 4 382 182 | one 8-K item: a dated corporate event of any kind |
|
| 218 |
| `pit` | 258 482 | one point-in-time earnings knowledge event, plus a Delta table |
|
| 219 |
|
| 220 |
+
**All four configs carry `knowledge_date`**, so all four mount, not only
|
| 221 |
+
`pit`: in `announcements` and `earnings` it is the acceptance instant itself,
|
| 222 |
+
in `events` it is exact where a header was read and the end of the filing day
|
| 223 |
+
otherwise. A config whose knowledge column is named anything else is refused by
|
| 224 |
+
ziplime rather than indexed on an event date.
|
| 225 |
+
|
| 226 |
`entity_id` in `pit` is the issuer CIK, the same key as every sibling dataset,
|
| 227 |
so an earnings date joins directly to
|
| 228 |
[company-fundamentals](https://huggingface.co/datasets/ZipLime/company-fundamentals),
|
data/announcements/part-00000.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3b24d428604fded6825662619c75f36ebb5ab573736f908e8c3e6e2be93de0a4
|
| 3 |
+
size 15198798
|
data/earnings/part-00000.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b8469e67dc22fba4f1f67e460b8e4591155dc61400013d4e6e6354206749e62
|
| 3 |
+
size 16694896
|
data/events/part-00000.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9da9fcf5b4482ba3eb5de06c07d80bf7717dccf71d9cda800a57a48d266a045c
|
| 3 |
+
size 27223687
|
data/events/part-00001.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0d6567c8fa7ae7707b9edd718adae62487cdab1cc9bb754c359807f1a85199af
|
| 3 |
+
size 24690613
|
data/events/part-00002.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2e7408fa1d159a740136f312e4f7bcb8d21bc4d990e5c9147eec0539c7f240b
|
| 3 |
+
size 4711234
|
data/pit/earnings_calendar.delta/_delta_log/00000000000000000000.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
{"commitInfo":{"timestamp":
|
| 2 |
{"protocol":{"minReaderVersion":1,"minWriterVersion":2}}
|
| 3 |
-
{"metaData":{"id":"
|
| 4 |
-
{"add":{"path":"part-00000-
|
|
|
|
| 1 |
+
{"commitInfo":{"timestamp":1788856505774,"operation":"WRITE","operationParameters":{"mode":"Overwrite"},"engineInfo":"delta-rs:py-1.6.2","operationMetrics":{"execution_time_ms":158,"num_added_files":1,"num_added_rows":258482,"num_partitions":0,"num_removed_files":0},"clientVersion":"delta-rs.py-1.6.2"}}
|
| 2 |
{"protocol":{"minReaderVersion":1,"minWriterVersion":2}}
|
| 3 |
+
{"metaData":{"id":"d37df37e-4293-4de1-afe0-235f97a825d1","name":null,"description":null,"format":{"provider":"parquet","options":{}},"schemaString":"{\"type\":\"struct\",\"fields\":[{\"name\":\"pit_event_id\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"entity_id\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"event_date\",\"type\":\"date\",\"nullable\":true,\"metadata\":{}},{\"name\":\"knowledge_date\",\"type\":\"timestamp\",\"nullable\":true,\"metadata\":{}},{\"name\":\"knowledge_estimated\",\"type\":\"boolean\",\"nullable\":true,\"metadata\":{}},{\"name\":\"ticker\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"ticker_confidence\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"session\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"first_tradeable_session\",\"type\":\"date\",\"nullable\":true,\"metadata\":{}},{\"name\":\"period_end\",\"type\":\"date\",\"nullable\":true,\"metadata\":{}},{\"name\":\"fiscal_period\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"eps_diluted\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"eps_quality\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"eps_yoy_change\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"sue\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"revenue\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"revenue_yoy_change\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"revenue_sue\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"net_income\",\"type\":\"double\",\"nullable\":true,\"metadata\":{}},{\"name\":\"currency\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"form\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"accession_number\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"figures_source\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"ingested_at\",\"type\":\"timestamp\",\"nullable\":true,\"metadata\":{}}]}","partitionColumns":[],"createdTime":1788856505616,"configuration":{}}}
|
| 4 |
+
{"add":{"path":"part-00000-a7ad72ab-857a-476e-a356-02d31ef3eef8-c000.snappy.parquet","partitionValues":{},"size":16340770,"modificationTime":1788856505774,"dataChange":true,"stats":"{\"numRecords\":258482,\"minValues\":{\"knowledge_date\":\"2009-01-09T22:13:43Z\",\"figures_source\":\"company_fundamentals\",\"eps_diluted\":-4510.0,\"ingested_at\":\"2026-09-08T08:34:06.096678Z\",\"fiscal_period\":\"FY\",\"net_income\":-49697000000.0,\"first_tradeable_session\":\"2009-01-12\",\"eps_yoy_change\":-9271.727272727272,\"accession_number\":\"0000002178-11-000006\",\"form\":\"8-K\",\"ticker\":\"A\",\"session\":\"after_close\",\"revenue\":-15680000000.0,\"sue\":-133166963.03466745,\"ticker_confidence\":\"as_of\",\"knowledge_estimated\":false,\"currency\":\"AUD\",\"revenue_yoy_change\":-17.055344070278185,\"pit_event_id\":\"0000001750|0001104659-10-037891\",\"period_end\":\"2008-11-30\",\"event_date\":\"2008-11-30\",\"eps_quality\":\"implausible\",\"revenue_sue\":-4262.800020702534,\"entity_id\":\"0000001750\"},\"maxValues\":{\"eps_diluted\":3550000.0,\"revenue_sue\":14806.482145891969,\"form\":\"8-K12B\",\"first_tradeable_session\":\"2026-07-01\",\"knowledge_date\":\"2026-06-30T20:02:19Z\",\"fiscal_period\":\"Q4\",\"accession_number\":\"0002096300-26-000011\",\"sue\":2312768022961400.0,\"currency\":\"USD\",\"revenue\":716924000000.0,\"eps_quality\":\"unverified\",\"ingested_at\":\"2026-09-08T08:34:06.096678Z\",\"ticker\":\"ZZ\",\"net_income\":132170000000.0,\"session\":\"pre_market\",\"revenue_yoy_change\":1387877.7878787878,\"period_end\":\"2026-05-31\",\"eps_yoy_change\":13148147.148148147,\"figures_source\":\"company_fundamentals\",\"ticker_confidence\":\"carried_forward\",\"pit_event_id\":\"0002114044|0001193125-26-233375\",\"event_date\":\"2026-05-31\",\"knowledge_estimated\":false,\"entity_id\":\"0002114044\"},\"nullCount\":{\"knowledge_date\":0,\"sue\":141526,\"revenue_yoy_change\":57288,\"pit_event_id\":0,\"fiscal_period\":21,\"knowledge_estimated\":0,\"eps_quality\":69047,\"eps_diluted\":69244,\"revenue\":34999,\"revenue_sue\":112498,\"ticker\":4141,\"first_tradeable_session\":0,\"net_income\":24688,\"accession_number\":0,\"eps_yoy_change\":91946,\"event_date\":0,\"form\":0,\"figures_source\":0,\"ticker_confidence\":4141,\"session\":0,\"ingested_at\":0,\"period_end\":0,\"entity_id\":0,\"currency\":691}}","tags":null,"baseRowId":null,"defaultRowCommitVersion":null,"clusteringProvider":null}}
|
data/pit/earnings_calendar.delta/{part-00000-78a686b7-f3d4-419e-b99c-f7d034d60a9d-c000.snappy.parquet → part-00000-a7ad72ab-857a-476e-a356-02d31ef3eef8-c000.snappy.parquet}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d480bb6490b4e10d509c54b26a3e99971fe7070a6f5d291e714e409ac5281101
|
| 3 |
+
size 16340770
|
data/pit/part-00000.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:072ed3f529e2b72d437e83e4818f4deca85c35ce7c19fb53878763a2398ab8b1
|
| 3 |
+
size 11500565
|
manifest.json
CHANGED
|
@@ -33,6 +33,7 @@
|
|
| 33 |
"form": "String",
|
| 34 |
"inserted_at": "Datetime(time_unit='us', time_zone='UTC')",
|
| 35 |
"items": "String",
|
|
|
|
| 36 |
"period_of_report": "Date",
|
| 37 |
"primary_document": "String",
|
| 38 |
"session": "String",
|
|
@@ -57,6 +58,7 @@
|
|
| 57 |
"fiscal_year": "Int32",
|
| 58 |
"form": "String",
|
| 59 |
"inserted_at": "Datetime(time_unit='us', time_zone='UTC')",
|
|
|
|
| 60 |
"net_income": "Float64",
|
| 61 |
"period_end": "Date",
|
| 62 |
"quarters": "Int32",
|
|
@@ -144,7 +146,7 @@
|
|
| 144 |
"event_date": "event_date",
|
| 145 |
"event_date_type": "date",
|
| 146 |
"frequency_seconds": null,
|
| 147 |
-
"generated_at": "2026-09-
|
| 148 |
"knowledge_date": "knowledge_date",
|
| 149 |
"knowledge_date_policy": {
|
| 150 |
"never_before_event_date": true,
|
|
@@ -170,7 +172,7 @@
|
|
| 170 |
"origin": "SEC EDGAR bulk submissions and filing headers; figures from ZipLime/company-fundamentals",
|
| 171 |
"package_version": "1.0.0",
|
| 172 |
"recipe": "recipe/",
|
| 173 |
-
"recipe_hash": "sha256:
|
| 174 |
"schedule": "10 9 * * 1",
|
| 175 |
"siblings": {
|
| 176 |
"calendar": "XNYS via exchange_calendars",
|
|
|
|
| 33 |
"form": "String",
|
| 34 |
"inserted_at": "Datetime(time_unit='us', time_zone='UTC')",
|
| 35 |
"items": "String",
|
| 36 |
+
"knowledge_date": "Datetime(time_unit='us', time_zone='UTC')",
|
| 37 |
"period_of_report": "Date",
|
| 38 |
"primary_document": "String",
|
| 39 |
"session": "String",
|
|
|
|
| 58 |
"fiscal_year": "Int32",
|
| 59 |
"form": "String",
|
| 60 |
"inserted_at": "Datetime(time_unit='us', time_zone='UTC')",
|
| 61 |
+
"knowledge_date": "Datetime(time_unit='us', time_zone='UTC')",
|
| 62 |
"net_income": "Float64",
|
| 63 |
"period_end": "Date",
|
| 64 |
"quarters": "Int32",
|
|
|
|
| 146 |
"event_date": "event_date",
|
| 147 |
"event_date_type": "date",
|
| 148 |
"frequency_seconds": null,
|
| 149 |
+
"generated_at": "2026-09-08T08:35:30.733063+00:00",
|
| 150 |
"knowledge_date": "knowledge_date",
|
| 151 |
"knowledge_date_policy": {
|
| 152 |
"never_before_event_date": true,
|
|
|
|
| 172 |
"origin": "SEC EDGAR bulk submissions and filing headers; figures from ZipLime/company-fundamentals",
|
| 173 |
"package_version": "1.0.0",
|
| 174 |
"recipe": "recipe/",
|
| 175 |
+
"recipe_hash": "sha256:a3eff0036d141fbceecb193332cd7e5433c90600568618791f014cce34d0ccd1",
|
| 176 |
"schedule": "10 9 * * 1",
|
| 177 |
"siblings": {
|
| 178 |
"calendar": "XNYS via exchange_calendars",
|
recipe/build.py
CHANGED
|
@@ -66,6 +66,7 @@ def build_announcements(
|
|
| 66 |
pl.col("reportDate").str.strptime(pl.Date, "%Y-%m-%d", strict=False)
|
| 67 |
.alias("period_of_report"),
|
| 68 |
pl.col("accepted_at").alias("announced_at"),
|
|
|
|
| 69 |
pl.when(pl.col("accepted_at").is_not_null())
|
| 70 |
.then(pl.lit("filing_header"))
|
| 71 |
.otherwise(pl.lit("unavailable"))
|
|
|
|
| 66 |
pl.col("reportDate").str.strptime(pl.Date, "%Y-%m-%d", strict=False)
|
| 67 |
.alias("period_of_report"),
|
| 68 |
pl.col("accepted_at").alias("announced_at"),
|
| 69 |
+
pl.col("accepted_at").alias("knowledge_date"),
|
| 70 |
pl.when(pl.col("accepted_at").is_not_null())
|
| 71 |
.then(pl.lit("filing_header"))
|
| 72 |
.otherwise(pl.lit("unavailable"))
|
recipe/earnings.py
CHANGED
|
@@ -172,7 +172,8 @@ def build_earnings(
|
|
| 172 |
candidates = (
|
| 173 |
announcements.select(
|
| 174 |
"cik", "accession_number", "form", "ticker", "ticker_confidence",
|
| 175 |
-
"announced_at", "
|
|
|
|
| 176 |
)
|
| 177 |
.join(periodic, on="cik", how="inner")
|
| 178 |
.filter(
|
|
|
|
| 172 |
candidates = (
|
| 173 |
announcements.select(
|
| 174 |
"cik", "accession_number", "form", "ticker", "ticker_confidence",
|
| 175 |
+
"announced_at", "knowledge_date", "announced_date_et", "session",
|
| 176 |
+
"first_tradeable_session",
|
| 177 |
)
|
| 178 |
.join(periodic, on="cik", how="inner")
|
| 179 |
.filter(
|
recipe/schema.py
CHANGED
|
@@ -33,6 +33,11 @@ ANNOUNCEMENT_SCHEMA: dict[str, pl.DataType] = {
|
|
| 33 |
"filed_date": pl.Date,
|
| 34 |
"period_of_report": pl.Date,
|
| 35 |
"announced_at": UTC_DATETIME,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
"announced_date_et": pl.Date,
|
| 37 |
"announced_time_et": pl.Time,
|
| 38 |
"session": pl.String,
|
|
@@ -58,6 +63,7 @@ EARNINGS_SCHEMA: dict[str, pl.DataType] = {
|
|
| 58 |
"ticker": pl.String,
|
| 59 |
"ticker_confidence": pl.String,
|
| 60 |
"announced_at": UTC_DATETIME,
|
|
|
|
| 61 |
"announced_date_et": pl.Date,
|
| 62 |
"session": pl.String,
|
| 63 |
"first_tradeable_session": pl.Date,
|
|
|
|
| 33 |
"filed_date": pl.Date,
|
| 34 |
"period_of_report": pl.Date,
|
| 35 |
"announced_at": UTC_DATETIME,
|
| 36 |
+
# The same instant under the name ziplime indexes on. Its adapter refuses a
|
| 37 |
+
# config whose knowledge column is not one of the conventional names rather
|
| 38 |
+
# than fall back to an event date, so without this alias the table is
|
| 39 |
+
# unmountable however correct `announced_at` is.
|
| 40 |
+
"knowledge_date": UTC_DATETIME,
|
| 41 |
"announced_date_et": pl.Date,
|
| 42 |
"announced_time_et": pl.Time,
|
| 43 |
"session": pl.String,
|
|
|
|
| 63 |
"ticker": pl.String,
|
| 64 |
"ticker_confidence": pl.String,
|
| 65 |
"announced_at": UTC_DATETIME,
|
| 66 |
+
"knowledge_date": UTC_DATETIME,
|
| 67 |
"announced_date_et": pl.Date,
|
| 68 |
"session": pl.String,
|
| 69 |
"first_tradeable_session": pl.Date,
|
tests/test_docs_and_jobs.py
CHANGED
|
@@ -108,3 +108,18 @@ def test_a_truncated_archive_is_rejected(tmp_path, monkeypatch):
|
|
| 108 |
archive.write_bytes(archive.read_bytes()[:-64]) # lose the central directory
|
| 109 |
with pytest.raises(RuntimeError, match=r"not a readable zip archive"):
|
| 110 |
bulk.check_archive(archive)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
archive.write_bytes(archive.read_bytes()[:-64]) # lose the central directory
|
| 109 |
with pytest.raises(RuntimeError, match=r"not a readable zip archive"):
|
| 110 |
bulk.check_archive(archive)
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
def test_every_config_can_be_mounted_by_ziplime():
|
| 114 |
+
"""ziplime indexes on a knowledge date and refuses a config that has none.
|
| 115 |
+
|
| 116 |
+
The names come from its adapter's preference list; a table whose knowledge
|
| 117 |
+
column is called something else is unusable as published, however correct
|
| 118 |
+
the column is. `events` was in exactly that position when first published.
|
| 119 |
+
"""
|
| 120 |
+
conventional = {
|
| 121 |
+
"feature_available_at", "knowledge_date", "knowledge_day",
|
| 122 |
+
"available_at", "disclosure_date", "notification_date", "date",
|
| 123 |
+
}
|
| 124 |
+
for name, schema in CONFIG_SCHEMAS.items():
|
| 125 |
+
assert conventional & set(schema), f"{name} has no knowledge-date column"
|