airless-google-cloud-core 0.3.0__tar.gz → 0.4.0.dev1__tar.gz
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.
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/PKG-INFO +1 -1
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/pubsub/hook/pubsub.py +12 -5
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless_google_cloud_core.egg-info/PKG-INFO +1 -1
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/pyproject.toml +2 -2
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/README.md +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/core/__init__.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/core/operator/__init__.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/core/operator/base.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/core/operator/delay.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/core/operator/redirect.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/pubsub/__init__.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless/google/cloud/pubsub/hook/__init__.py +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless_google_cloud_core.egg-info/SOURCES.txt +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless_google_cloud_core.egg-info/dependency_links.txt +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless_google_cloud_core.egg-info/requires.txt +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/airless_google_cloud_core.egg-info/top_level.txt +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/requirements.txt +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/setup.cfg +0 -0
- {airless_google_cloud_core-0.3.0 → airless_google_cloud_core-0.4.0.dev1}/tests/test_fake.py +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import json
|
|
3
2
|
from typing import Any
|
|
4
3
|
|
|
@@ -28,13 +27,21 @@ class GooglePubsubHook(QueueHook):
|
|
|
28
27
|
str: A confirmation message.
|
|
29
28
|
"""
|
|
30
29
|
if get_config('ENV') == 'prod':
|
|
31
|
-
topic_path = self.publisher.topic_path(
|
|
30
|
+
topic_path = self.publisher.topic_path(
|
|
31
|
+
project or get_config('GCP_PROJECT'), topic
|
|
32
|
+
)
|
|
32
33
|
|
|
33
34
|
message_bytes = json.dumps(data, default=str).encode('utf-8')
|
|
34
35
|
|
|
35
36
|
publish_future = self.publisher.publish(topic_path, data=message_bytes)
|
|
36
|
-
publish_future.result(
|
|
37
|
-
|
|
37
|
+
publish_future.result(
|
|
38
|
+
timeout=int(get_config('PUBSUB_PUBLISH_TIMEOUT', False) or 10)
|
|
39
|
+
)
|
|
40
|
+
self.logger.info(
|
|
41
|
+
f'published to {project or get_config("GCP_PROJECT")}.{topic}'
|
|
42
|
+
)
|
|
38
43
|
return 'Message published.'
|
|
39
44
|
else:
|
|
40
|
-
self.logger.debug(
|
|
45
|
+
self.logger.debug(
|
|
46
|
+
f'[DEV] Message published to Project {project or get_config("GCP_PROJECT")}, Topic {topic}: {data}'
|
|
47
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "airless-google-cloud-core"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0.dev1"
|
|
4
4
|
description = "Airless package with the main components to use airless in google cloud"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.9"
|
|
@@ -54,4 +54,4 @@ indent-style = "space"
|
|
|
54
54
|
skip-magic-trailing-comma = false
|
|
55
55
|
line-ending = "lf"
|
|
56
56
|
docstring-code-format = false
|
|
57
|
-
docstring-code-line-length = "dynamic"
|
|
57
|
+
docstring-code-line-length = "dynamic"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|