Skip to content

Commit 0ea14a9

Browse files
committed
rename to connectors
1 parent 1a29ac5 commit 0ea14a9

4 files changed

Lines changed: 3 additions & 35 deletions

File tree

azure/functions/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
from ._http_asgi import AsgiMiddleware
2323
from .kafka import KafkaEvent, KafkaConverter, KafkaTriggerConverter
2424
from .mcp import MCPToolContext, PromptInvocationContext
25-
from .connector import ConnectorContext
2625
from .meta import get_binding_registry
2726
from ._queue import QueueMessage
2827
from ._servicebus import ServiceBusMessage
@@ -44,7 +43,7 @@
4443
from . import sql # NoQA
4544
from . import warmup # NoQA
4645
from . import mysql # NoQA
47-
from . import connector # NoQA
46+
from . import connectors # NoQA
4847

4948

5049
__all__ = (
@@ -78,7 +77,6 @@
7877
'WarmUpContext',
7978
'MySqlRow',
8079
'MySqlRowList',
81-
'ConnectorContext',
8280

8381
# Middlewares
8482
'WsgiMiddleware',
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,12 @@
66
from . import meta
77

88

9-
class ConnectorContext(typing.Dict[str, typing.Any]):
10-
"""Context object for connector triggers."""
11-
pass
12-
13-
149
class ConnectorTriggerConverter(meta.InConverter, binding='connectorTrigger',
1510
trigger=True):
1611

1712
@classmethod
1813
def check_input_type_annotation(cls, pytype: type) -> bool:
19-
return issubclass(pytype, (str, dict, bytes, ConnectorContext))
14+
return issubclass(pytype, (str, dict, bytes))
2015

2116
@classmethod
2217
def has_implicit_output(cls) -> bool:

azure/functions/decorators/generic.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,3 @@ def __init__(self,
4646
data_type: Optional[DataType] = None,
4747
**kwargs):
4848
super().__init__(name=name, data_type=data_type, type=type)
49-
50-
51-
class ConnectorTrigger(Trigger):
52-
53-
@staticmethod
54-
def get_binding_name():
55-
from azure.functions.decorators.constants import CONNECTOR_TRIGGER
56-
return CONNECTOR_TRIGGER
57-
58-
def __init__(self,
59-
name: str,
60-
data_type: Optional[DataType] = None,
61-
**kwargs):
62-
from azure.functions.decorators.constants import CONNECTOR_TRIGGER
63-
super().__init__(name=name, data_type=data_type, type=CONNECTOR_TRIGGER)

tests/test_connector.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
import json
55
import azure.functions as func
66
from azure.functions.meta import Datum
7-
from azure.functions.connector import (ConnectorTriggerConverter,
8-
ConnectorContext)
7+
from azure.functions.connectors import ConnectorTriggerConverter
98

109

1110
class TestConnectorTriggerConverter(unittest.TestCase):
@@ -15,7 +14,6 @@ def test_check_input_type_annotation_valid_types(self):
1514
self.assertTrue(ConnectorTriggerConverter.check_input_type_annotation(str))
1615
self.assertTrue(ConnectorTriggerConverter.check_input_type_annotation(dict))
1716
self.assertTrue(ConnectorTriggerConverter.check_input_type_annotation(bytes))
18-
self.assertTrue(ConnectorTriggerConverter.check_input_type_annotation(ConnectorContext))
1917

2018
def test_check_input_type_annotation_invalid_type(self):
2119
with self.assertRaises(TypeError):
@@ -106,14 +104,6 @@ def test_encode_other_type(self):
106104
self.assertEqual(result.type, 'string')
107105
self.assertEqual(result.value, 'True')
108106

109-
def test_connector_context_is_dict_subclass(self):
110-
# Verify ConnectorContext is a dict subclass
111-
self.assertTrue(issubclass(ConnectorContext, dict))
112-
113-
# Test that it can be instantiated and used as a dict
114-
ctx = ConnectorContext({'key': 'value'})
115-
self.assertEqual(ctx['key'], 'value')
116-
117107

118108
class TestConnectorDecoratorIntegration(unittest.TestCase):
119109
"""Integration tests for the connector trigger decorator"""

0 commit comments

Comments
 (0)