apache-airflow-providers-telegram 3.1.1__py3-none-any.whl → 4.0.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.
- airflow/providers/telegram/get_provider_info.py +2 -1
- airflow/providers/telegram/hooks/telegram.py +6 -4
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/METADATA +18 -6
- apache_airflow_providers_telegram-4.0.0.dist-info/RECORD +13 -0
- apache_airflow_providers_telegram-3.1.1.dist-info/RECORD +0 -13
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/LICENSE +0 -0
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/NOTICE +0 -0
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/WHEEL +0 -0
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/entry_points.txt +0 -0
- {apache_airflow_providers_telegram-3.1.1.dist-info → apache_airflow_providers_telegram-4.0.0.dist-info}/top_level.txt +0 -0
@@ -28,6 +28,7 @@ def get_provider_info():
|
|
28
28
|
"name": "Telegram",
|
29
29
|
"description": "`Telegram <https://telegram.org/>`__\n",
|
30
30
|
"versions": [
|
31
|
+
"4.0.0",
|
31
32
|
"3.1.1",
|
32
33
|
"3.1.0",
|
33
34
|
"3.0.0",
|
@@ -40,7 +41,7 @@ def get_provider_info():
|
|
40
41
|
"1.0.1",
|
41
42
|
"1.0.0",
|
42
43
|
],
|
43
|
-
"dependencies": ["apache-airflow>=2.3.0", "python-telegram-bot>=
|
44
|
+
"dependencies": ["apache-airflow>=2.3.0", "python-telegram-bot>=20.0.0"],
|
44
45
|
"integrations": [
|
45
46
|
{
|
46
47
|
"integration-name": "Telegram",
|
@@ -18,6 +18,8 @@
|
|
18
18
|
"""Hook for Telegram"""
|
19
19
|
from __future__ import annotations
|
20
20
|
|
21
|
+
import asyncio
|
22
|
+
|
21
23
|
import telegram
|
22
24
|
import tenacity
|
23
25
|
|
@@ -67,13 +69,13 @@ class TelegramHook(BaseHook):
|
|
67
69
|
self.chat_id = self.__get_chat_id(chat_id, telegram_conn_id)
|
68
70
|
self.connection = self.get_conn()
|
69
71
|
|
70
|
-
def get_conn(self) -> telegram.
|
72
|
+
def get_conn(self) -> telegram.Bot:
|
71
73
|
"""
|
72
74
|
Returns the telegram bot client
|
73
75
|
|
74
76
|
:return: telegram bot client
|
75
77
|
"""
|
76
|
-
return telegram.
|
78
|
+
return telegram.Bot(self.token)
|
77
79
|
|
78
80
|
def __get_token(self, token: str | None, telegram_conn_id: str | None) -> str:
|
79
81
|
"""
|
@@ -126,7 +128,7 @@ class TelegramHook(BaseHook):
|
|
126
128
|
"""
|
127
129
|
kwargs = {
|
128
130
|
"chat_id": self.chat_id,
|
129
|
-
"parse_mode": telegram.
|
131
|
+
"parse_mode": telegram.constants.ParseMode.HTML,
|
130
132
|
"disable_web_page_preview": True,
|
131
133
|
}
|
132
134
|
kwargs.update(api_params)
|
@@ -137,5 +139,5 @@ class TelegramHook(BaseHook):
|
|
137
139
|
if kwargs["chat_id"] is None:
|
138
140
|
raise AirflowException("'chat_id' must be provided for telegram message")
|
139
141
|
|
140
|
-
response = self.connection.send_message(**kwargs)
|
142
|
+
response = asyncio.run(self.connection.send_message(**kwargs))
|
141
143
|
self.log.debug(response)
|
@@ -1,13 +1,13 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: apache-airflow-providers-telegram
|
3
|
-
Version:
|
3
|
+
Version: 4.0.0
|
4
4
|
Summary: Provider for Apache Airflow. Implements apache-airflow-providers-telegram package
|
5
5
|
Home-page: https://airflow.apache.org/
|
6
6
|
Author: Apache Software Foundation
|
7
7
|
Author-email: dev@airflow.apache.org
|
8
8
|
License: Apache License 2.0
|
9
9
|
Download-URL: https://archive.apache.org/dist/airflow/providers
|
10
|
-
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/
|
10
|
+
Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/
|
11
11
|
Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
|
12
12
|
Project-URL: Source Code, https://github.com/apache/airflow
|
13
13
|
Project-URL: Slack Chat, https://s.apache.org/airflow-slack
|
@@ -32,7 +32,7 @@ Description-Content-Type: text/x-rst
|
|
32
32
|
License-File: LICENSE
|
33
33
|
License-File: NOTICE
|
34
34
|
Requires-Dist: apache-airflow (>=2.3.0)
|
35
|
-
Requires-Dist: python-telegram-bot (
|
35
|
+
Requires-Dist: python-telegram-bot (>=20.0.0)
|
36
36
|
|
37
37
|
|
38
38
|
.. Licensed to the Apache Software Foundation (ASF) under one
|
@@ -55,7 +55,7 @@ Requires-Dist: python-telegram-bot (<20.0.0,>=13.0)
|
|
55
55
|
|
56
56
|
Package ``apache-airflow-providers-telegram``
|
57
57
|
|
58
|
-
Release: ``
|
58
|
+
Release: ``4.0.0``
|
59
59
|
|
60
60
|
|
61
61
|
`Telegram <https://telegram.org/>`__
|
@@ -68,7 +68,7 @@ This is a provider package for ``telegram`` provider. All classes for this provi
|
|
68
68
|
are in ``airflow.providers.telegram`` python package.
|
69
69
|
|
70
70
|
You can find package information and changelog for the provider
|
71
|
-
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/
|
71
|
+
in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-telegram/4.0.0/>`_.
|
72
72
|
|
73
73
|
|
74
74
|
Installation
|
@@ -87,7 +87,7 @@ Requirements
|
|
87
87
|
PIP package Version required
|
88
88
|
======================= ==================
|
89
89
|
``apache-airflow`` ``>=2.3.0``
|
90
|
-
``python-telegram-bot`` ``>=
|
90
|
+
``python-telegram-bot`` ``>=20.0.0``
|
91
91
|
======================= ==================
|
92
92
|
|
93
93
|
.. Licensed to the Apache Software Foundation (ASF) under one
|
@@ -116,6 +116,18 @@ PIP package Version required
|
|
116
116
|
Changelog
|
117
117
|
---------
|
118
118
|
|
119
|
+
4.0.0
|
120
|
+
.....
|
121
|
+
|
122
|
+
Breaking changes
|
123
|
+
~~~~~~~~~~~~~~~~
|
124
|
+
|
125
|
+
In this version, we upgraded the ``python-telegram-bot`` to ``20.0.0`` and above.
|
126
|
+
All remains the same except that now the ``get_conn()`` method in ``TelegramHook`` is a coroutine function.
|
127
|
+
Refer to `python-telegram-bot transition guide <https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-20.0#asyncio>`_ for more details.
|
128
|
+
|
129
|
+
* ``Updated Telegram Provider to ensure compatbility with >=20.0.0 (#28953)``
|
130
|
+
|
119
131
|
3.1.1
|
120
132
|
.....
|
121
133
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
airflow/providers/telegram/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
2
|
+
airflow/providers/telegram/get_provider_info.py,sha256=FnvbDRgXqQnn1zKNIG-r-nqE4guChmloLzdqT-2xgjc,2293
|
3
|
+
airflow/providers/telegram/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
4
|
+
airflow/providers/telegram/hooks/telegram.py,sha256=hZBAWSJes63xwofdlH0gXtr29_X6-rPGtlRBnmREoVY,5237
|
5
|
+
airflow/providers/telegram/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
6
|
+
airflow/providers/telegram/operators/telegram.py,sha256=gHQbi-fUUfUD09cTdAMWK244Rmo6l299eba14RqItqk,3011
|
7
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
8
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/METADATA,sha256=JC1edGCZVe6qI91RL0Xhhp5G5hNwgMSpqSVT0NueEcM,9805
|
9
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
|
10
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
11
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/entry_points.txt,sha256=mAP59DYznehjP25NH3twikokfTrEMNA2-tib1eF3G5E,106
|
12
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
|
13
|
+
apache_airflow_providers_telegram-4.0.0.dist-info/RECORD,,
|
@@ -1,13 +0,0 @@
|
|
1
|
-
airflow/providers/telegram/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
2
|
-
airflow/providers/telegram/get_provider_info.py,sha256=qm5C-pUE5V4edvfZyTzzcaDQ7jEShfcI7VyPOuqGlag,2278
|
3
|
-
airflow/providers/telegram/hooks/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
4
|
-
airflow/providers/telegram/hooks/telegram.py,sha256=ojpwKZjBYpiFv0OJCkZc1XBNMMuFz3YfRt8toqmuDbg,5222
|
5
|
-
airflow/providers/telegram/operators/__init__.py,sha256=mlJxuZLkd5x-iq2SBwD3mvRQpt3YR7wjz_nceyF1IaI,787
|
6
|
-
airflow/providers/telegram/operators/telegram.py,sha256=gHQbi-fUUfUD09cTdAMWK244Rmo6l299eba14RqItqk,3011
|
7
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/LICENSE,sha256=gXPVwptPlW1TJ4HSuG5OMPg-a3h43OGMkZRR1rpwfJA,10850
|
8
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/METADATA,sha256=MT-nZ6gRalncIYgHhIixGDIa4LZqrHi_QjtkPhC9ItA,9325
|
9
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/NOTICE,sha256=m-6s2XynUxVSUIxO4rVablAZCvFq-wmLrqV91DotRBw,240
|
10
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
11
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/entry_points.txt,sha256=mAP59DYznehjP25NH3twikokfTrEMNA2-tib1eF3G5E,106
|
12
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/top_level.txt,sha256=OeMVH5md7fr2QQWpnZoOWWxWO-0WH1IP70lpTVwopPg,8
|
13
|
-
apache_airflow_providers_telegram-3.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|