Skip to content

Commit bb99d2b

Browse files
committed
🚧 (helpers) Make bulk writer accept origin
1 parent d701d2a commit bb99d2b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openaleph_procrastinate/helpers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ def load_entity(dataset: str, entity_id: str) -> EntityProxy:
6161

6262

6363
@contextmanager
64-
def entity_writer(dataset: str) -> Generator[BulkLoader, None, None]:
64+
def entity_writer(
65+
dataset: str, origin: str = OPAL_ORIGIN
66+
) -> Generator[BulkLoader, None, None]:
6567
"""
6668
Get the `ftmq.store.fragments.BulkLoader` for the given `dataset`. The
6769
writer is flushed when leaving the context.
6870
"""
6971
store = get_fragments(
7072
dataset,
71-
origin=OPAL_ORIGIN,
73+
origin=origin,
7274
database_uri=settings.fragments_uri,
7375
**sqlalchemy_pool,
7476
)

0 commit comments

Comments
 (0)