Skip to content

Commit 4000a71

Browse files
Merge pull request #2607 from airbytehq/publish/snapchat-marketing-v0.1.4
chore(snapchat-marketing): bump to 0.1.4
2 parents 80ce7c4 + a1caa78 commit 4000a71

File tree

6 files changed

+99
-12
lines changed

6 files changed

+99
-12
lines changed

connectors/snapchat-marketing/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Snapchat Marketing changelog
22

3+
## [0.1.4] - 2026-03-23
4+
- Updated connector definition (YAML version 1.0.1)
5+
- Source commit: 6ad04bc3
6+
- SDK version: 0.1.0
7+
38
## [0.1.3] - 2026-03-23
49
- Updated connector definition (YAML version 1.0.1)
510
- Source commit: 5718dee3

connectors/snapchat-marketing/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ See the official [Snapchat-Marketing API reference](https://developers.snap.com/
116116

117117
## Version information
118118

119-
- **Package version:** 0.1.3
119+
- **Package version:** 0.1.4
120120
- **Connector version:** 1.0.1
121-
- **Generated with Connector SDK commit SHA:** 5718dee300be8dbcbdece58f9474cf54625872e7
121+
- **Generated with Connector SDK commit SHA:** 6ad04bc3fb66fc474336c37d69c79fb843ea1609
122122
- **Changelog:** [View changelog](https://github.com/airbytehq/airbyte-agent-connectors/blob/main/connectors/snapchat-marketing/CHANGELOG.md)

connectors/snapchat-marketing/airbyte_agent_snapchat_marketing/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
CampaignObjectiveV2Properties,
1616
Campaign,
1717
AdSquadSkadnetworkProperties,
18+
AdSquadTargetingGeosItem,
1819
AdSquadTargetingAutoExpansionOptionsInterestExpansionOption,
1920
AdSquadTargetingAutoExpansionOptions,
20-
AdSquadTargetingGeosItem,
2121
AdSquadTargeting,
2222
AdSquad,
2323
Ad,
@@ -123,9 +123,9 @@
123123
"CampaignObjectiveV2Properties",
124124
"Campaign",
125125
"AdSquadSkadnetworkProperties",
126+
"AdSquadTargetingGeosItem",
126127
"AdSquadTargetingAutoExpansionOptionsInterestExpansionOption",
127128
"AdSquadTargetingAutoExpansionOptions",
128-
"AdSquadTargetingGeosItem",
129129
"AdSquadTargeting",
130130
"AdSquad",
131131
"Ad",

connectors/snapchat-marketing/airbyte_agent_snapchat_marketing/_vendored/connector_sdk/executor/local_executor.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,88 @@ async def check(self) -> ExecutionResult:
602602
error=str(e),
603603
)
604604

605+
async def check_entities(self, entities: list[str]) -> ExecutionResult:
606+
"""Perform health checks for specific entities by probing their list or get operations.
607+
608+
For each entity, looks up (entity_name, Action.LIST) in the operation index.
609+
If not found, falls back to (entity_name, Action.GET). Runs all probes
610+
concurrently and returns per-entity results.
611+
612+
Args:
613+
entities: List of entity names to check.
614+
615+
Returns:
616+
ExecutionResult with per-entity health check results.
617+
"""
618+
logging.debug("check_entities: probing entities %s", entities)
619+
620+
standard_handler = next(
621+
(h for h in self._operation_handlers if isinstance(h, _StandardOperationHandler)),
622+
None,
623+
)
624+
625+
if standard_handler is None:
626+
entity_results = [
627+
{"entity": name, "status": "skipped", "error": "No standard handler available", "checked_action": None}
628+
for name in entities
629+
]
630+
return ExecutionResult(
631+
success=not entities,
632+
data={"entity_results": entity_results, "status": "unhealthy" if entities else "healthy"},
633+
)
634+
635+
tasks = [self._probe_entity(name, standard_handler) for name in entities]
636+
entity_results = await asyncio.gather(*tasks)
637+
638+
all_healthy = all(r["status"] == "healthy" for r in entity_results)
639+
failed = [r for r in entity_results if r["status"] != "healthy"]
640+
error = None
641+
if failed:
642+
names = ", ".join(r["entity"] for r in failed)
643+
error = f"Entity check failed for: {names}"
644+
return ExecutionResult(
645+
success=all_healthy,
646+
data={
647+
"entity_results": list(entity_results),
648+
"status": "healthy" if all_healthy else "unhealthy",
649+
},
650+
error=error,
651+
)
652+
653+
async def _probe_entity(self, entity_name: str, standard_handler: _StandardOperationHandler) -> dict[str, Any]:
654+
"""Probe a single entity's health by executing its list or get operation."""
655+
endpoint = self._operation_index.get((entity_name, Action.LIST))
656+
action = Action.LIST
657+
if endpoint is None:
658+
endpoint = self._operation_index.get((entity_name, Action.GET))
659+
action = Action.GET
660+
if endpoint is None:
661+
return {
662+
"entity": entity_name,
663+
"status": "failed",
664+
"error": f"Entity '{entity_name}' has no list or get operation available for checking",
665+
"status_code": None,
666+
"checked_action": None,
667+
}
668+
try:
669+
params = {"limit": 1} if action == Action.LIST else {}
670+
await standard_handler.execute_operation(entity_name, action, params)
671+
return {
672+
"entity": entity_name,
673+
"status": "healthy",
674+
"error": None,
675+
"status_code": None,
676+
"checked_action": action.value,
677+
}
678+
except Exception as e:
679+
return {
680+
"entity": entity_name,
681+
"status": "unhealthy",
682+
"error": str(e),
683+
"status_code": getattr(e, "status_code", None),
684+
"checked_action": action.value,
685+
}
686+
605687
async def _execute_operation(
606688
self,
607689
entity: str,

connectors/snapchat-marketing/airbyte_agent_snapchat_marketing/models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,13 @@ class AdSquadSkadnetworkProperties(BaseModel):
134134
enable_skoverlay: Union[bool, Any] = Field(default=None)
135135
status: Union[str, Any] = Field(default=None)
136136

137+
class AdSquadTargetingGeosItem(BaseModel):
138+
"""Nested schema for AdSquadTargeting.geos_item"""
139+
model_config = ConfigDict(extra="allow", populate_by_name=True)
140+
141+
country_code: Union[str, Any] = Field(default=None)
142+
operation: Union[str, Any] = Field(default=None)
143+
137144
class AdSquadTargetingAutoExpansionOptionsInterestExpansionOption(BaseModel):
138145
"""Nested schema for AdSquadTargetingAutoExpansionOptions.interest_expansion_option"""
139146
model_config = ConfigDict(extra="allow", populate_by_name=True)
@@ -146,13 +153,6 @@ class AdSquadTargetingAutoExpansionOptions(BaseModel):
146153

147154
interest_expansion_option: Union[AdSquadTargetingAutoExpansionOptionsInterestExpansionOption, Any] = Field(default=None)
148155

149-
class AdSquadTargetingGeosItem(BaseModel):
150-
"""Nested schema for AdSquadTargeting.geos_item"""
151-
model_config = ConfigDict(extra="allow", populate_by_name=True)
152-
153-
country_code: Union[str, Any] = Field(default=None)
154-
operation: Union[str, Any] = Field(default=None)
155-
156156
class AdSquadTargeting(BaseModel):
157157
"""Targeting specification"""
158158
model_config = ConfigDict(extra="allow", populate_by_name=True)

connectors/snapchat-marketing/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "airbyte-agent-snapchat-marketing"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
description = "Airbyte Snapchat-Marketing Connector for AI platforms"
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)