dagster-postgres 0.22.14__tar.gz → 0.23.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dagster-postgres might be problematic. Click here for more details.
- {dagster-postgres-0.22.14/dagster_postgres.egg-info → dagster-postgres-0.23.0}/PKG-INFO +1 -1
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/event_log/event_log.py +25 -3
- dagster-postgres-0.23.0/dagster_postgres/version.py +1 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0/dagster_postgres.egg-info}/PKG-INFO +1 -1
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/requires.txt +1 -1
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/setup.py +1 -1
- dagster-postgres-0.22.14/dagster_postgres/version.py +0 -1
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/LICENSE +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/MANIFEST.in +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/README.md +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/__init__.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/alembic/alembic.ini +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/event_log/__init__.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/py.typed +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/run_storage/__init__.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/run_storage/run_storage.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/schedule_storage/__init__.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/schedule_storage/schedule_storage.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/storage.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/utils.py +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/SOURCES.txt +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/dependency_links.txt +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/not-zip-safe +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/top_level.txt +0 -0
- {dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/setup.cfg +0 -0
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/event_log/event_log.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from contextlib import contextmanager
|
|
2
|
-
from typing import Any, ContextManager, Iterator, Mapping, Optional, Sequence
|
|
2
|
+
from typing import Any, ContextManager, Iterator, Mapping, Optional, Sequence, cast
|
|
3
3
|
|
|
4
4
|
import dagster._check as check
|
|
5
5
|
import sqlalchemy as db
|
|
@@ -8,7 +8,7 @@ import sqlalchemy.pool as db_pool
|
|
|
8
8
|
from dagster._config.config_schema import UserConfigSchema
|
|
9
9
|
from dagster._core.errors import DagsterInvariantViolationError
|
|
10
10
|
from dagster._core.event_api import EventHandlerFn
|
|
11
|
-
from dagster._core.events import ASSET_CHECK_EVENTS, ASSET_EVENTS
|
|
11
|
+
from dagster._core.events import ASSET_CHECK_EVENTS, ASSET_EVENTS, BATCH_WRITABLE_EVENTS
|
|
12
12
|
from dagster._core.events.log import EventLogEntry
|
|
13
13
|
from dagster._core.storage.config import pg_config
|
|
14
14
|
from dagster._core.storage.event_log import (
|
|
@@ -173,6 +173,7 @@ class PostgresEventLogStorage(SqlEventLogStorage, ConfigurableClass):
|
|
|
173
173
|
event (EventLogEntry): The event to store.
|
|
174
174
|
"""
|
|
175
175
|
check.inst_param(event, "event", EventLogEntry)
|
|
176
|
+
|
|
176
177
|
insert_event_statement = self.prepare_insert_event(event) # from SqlEventLogStorage.py
|
|
177
178
|
with self._connect() as conn:
|
|
178
179
|
result = conn.execute(
|
|
@@ -202,11 +203,32 @@ class PostgresEventLogStorage(SqlEventLogStorage, ConfigurableClass):
|
|
|
202
203
|
"Cannot store asset event tags for null event id."
|
|
203
204
|
)
|
|
204
205
|
|
|
205
|
-
self.store_asset_event_tags(event, event_id)
|
|
206
|
+
self.store_asset_event_tags([event], [event_id])
|
|
206
207
|
|
|
207
208
|
if event.is_dagster_event and event.dagster_event_type in ASSET_CHECK_EVENTS:
|
|
208
209
|
self.store_asset_check_event(event, event_id)
|
|
209
210
|
|
|
211
|
+
def store_event_batch(self, events: Sequence[EventLogEntry]) -> None:
|
|
212
|
+
check.sequence_param(events, "event", of_type=EventLogEntry)
|
|
213
|
+
|
|
214
|
+
check.invariant(
|
|
215
|
+
all(event.get_dagster_event().event_type in BATCH_WRITABLE_EVENTS for event in events),
|
|
216
|
+
f"{BATCH_WRITABLE_EVENTS} are the only currently supported events for batch writes.",
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
insert_event_statement = self.prepare_insert_event_batch(events)
|
|
220
|
+
with self._connect() as conn:
|
|
221
|
+
result = conn.execute(insert_event_statement.returning(SqlEventLogStorageTable.c.id))
|
|
222
|
+
event_ids = [cast(int, row[0]) for row in result.fetchall()]
|
|
223
|
+
|
|
224
|
+
# We only update the asset table with the last event
|
|
225
|
+
self.store_asset_event(events[-1], event_ids[-1])
|
|
226
|
+
|
|
227
|
+
if any((event_id is None for event_id in event_ids)):
|
|
228
|
+
raise DagsterInvariantViolationError("Cannot store asset event tags for null event id.")
|
|
229
|
+
|
|
230
|
+
self.store_asset_event_tags(events, event_ids)
|
|
231
|
+
|
|
210
232
|
def store_asset_event(self, event: EventLogEntry, event_id: int) -> None:
|
|
211
233
|
check.inst_param(event, "event", EventLogEntry)
|
|
212
234
|
if not (event.dagster_event and event.dagster_event.asset_key):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.23.0"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
dagster==1.
|
|
1
|
+
dagster==1.7.0
|
|
2
2
|
psycopg2-binary
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.22.14"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/run_storage/__init__.py
RENAMED
|
File without changes
|
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/run_storage/run_storage.py
RENAMED
|
File without changes
|
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres/schedule_storage/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dagster-postgres-0.22.14 → dagster-postgres-0.23.0}/dagster_postgres.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|