airbyte-internal-ops 0.1.10__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.
@@ -305,32 +305,33 @@ SELECT_SUCCESSFUL_SYNCS_FOR_VERSION = sqlalchemy.text(
305
305
  """
306
306
  )
307
307
 
308
- # Get failed attempt results for actors pinned to a specific connector definition VERSION ID
309
- # Includes attempt details (failure_summary, etc.) for research/debugging
310
- # Filters on attempts.status = 'failed' to capture all failed attempts, including those
311
- # from jobs that eventually succeeded via retry. The latest_job_attempt_status field
312
- # indicates whether the job eventually succeeded or remained failed.
313
- # Query starts from attempts table to leverage indexed columns (ended_at, status)
314
- # Note: attempts.ended_at and attempts.status are indexed (btree)
315
- SELECT_FAILED_SYNC_ATTEMPTS_FOR_VERSION = sqlalchemy.text(
308
+ # Get failed attempt results for ALL actors using a connector definition.
309
+ # Finds all actors with the given actor_definition_id and returns their failed sync attempts,
310
+ # regardless of whether they have explicit version pins.
311
+ # Query starts from attempts table to leverage indexed columns (ended_at, status).
312
+ # Note: This query only supports SOURCE connectors (joins via connection.source_id).
313
+ # The LEFT JOIN to scoped_configuration provides pin context when available (pin_origin_type,
314
+ # pin_origin, pinned_version_id will be NULL for unpinned actors).
315
+ SELECT_FAILED_SYNC_ATTEMPTS_FOR_CONNECTOR = sqlalchemy.text(
316
316
  """
317
317
  SELECT
318
318
  jobs.id AS job_id,
319
319
  jobs.scope AS connection_id,
320
- jobs.status AS latest_job_attempt_status,
320
+ jobs.status AS latest_job_status,
321
321
  jobs.started_at AS job_started_at,
322
322
  jobs.updated_at AS job_updated_at,
323
323
  connection.name AS connection_name,
324
324
  actor.id AS actor_id,
325
325
  actor.name AS actor_name,
326
326
  actor.actor_definition_id,
327
- scoped_configuration.origin_type AS pin_origin_type,
328
- scoped_configuration.origin AS pin_origin,
329
327
  workspace.id AS workspace_id,
330
328
  workspace.name AS workspace_name,
331
329
  workspace.organization_id,
332
330
  workspace.dataplane_group_id,
333
331
  dataplane_group.name AS dataplane_name,
332
+ scoped_configuration.origin_type AS pin_origin_type,
333
+ scoped_configuration.origin AS pin_origin,
334
+ scoped_configuration.value AS pinned_version_id,
334
335
  attempts.id AS failed_attempt_id,
335
336
  attempts.attempt_number AS failed_attempt_number,
336
337
  attempts.status AS failed_attempt_status,
@@ -347,15 +348,15 @@ SELECT_FAILED_SYNC_ATTEMPTS_FOR_VERSION = sqlalchemy.text(
347
348
  ON jobs.scope = connection.id::text
348
349
  JOIN actor
349
350
  ON connection.source_id = actor.id
350
- JOIN scoped_configuration
351
- ON scoped_configuration.scope_id = actor.id
352
- AND scoped_configuration.key = 'connector_version'
353
- AND scoped_configuration.scope_type = 'actor'
354
- AND scoped_configuration.value = :actor_definition_version_id
351
+ AND actor.actor_definition_id = :connector_definition_id
355
352
  JOIN workspace
356
353
  ON actor.workspace_id = workspace.id
357
354
  LEFT JOIN dataplane_group
358
355
  ON workspace.dataplane_group_id = dataplane_group.id
356
+ LEFT JOIN scoped_configuration
357
+ ON scoped_configuration.scope_id = actor.id
358
+ AND scoped_configuration.key = 'connector_version'
359
+ AND scoped_configuration.scope_type = 'actor'
359
360
  WHERE
360
361
  attempts.ended_at >= :cutoff_date
361
362
  AND attempts.status = 'failed'