Skip to content

Commit c6187fe

Browse files
committed
source-shopify-native: use update_config hook for legacy config migration
Move the legacy single-store config migration out of `open()` and into the new `update_config` hook, removing the inline encryption and event emission.
1 parent 3e4b9a2 commit c6187fe

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

source-shopify-native/source_shopify_native/__init__.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,20 +151,22 @@ async def validate(
151151
resolved = common.resolve_bindings(validate.bindings, resources)
152152
return common.validated(resolved)
153153

154+
async def update_config(
155+
self,
156+
log: FlowLogger,
157+
config: EndpointConfig,
158+
) -> tuple[str, EndpointConfig] | None:
159+
if config._was_migrated:
160+
return ("Migrating legacy single-store config to multi-store format.", config)
161+
return None
162+
154163
async def open(
155164
self,
156165
log: FlowLogger,
157166
open: request.Open[EndpointConfig, ResourceConfig, ConnectorState],
158167
) -> tuple[response.Opened, Callable[[Task], Awaitable[None]]]:
159168
config = open.capture.config
160169

161-
if config._was_migrated:
162-
encrypted_config = await self._encrypt_config(log, config)
163-
log.event.config_update(
164-
"Migrating legacy single-store config to multi-store format.",
165-
encrypted_config,
166-
)
167-
168170
resources = await all_resources(
169171
log, self, config, should_cancel_ongoing_job=True
170172
)

0 commit comments

Comments
 (0)