Skip to content

Commit d4e4e24

Browse files
authored
MRG: Merge pull request #9 from octue/store-event-kind-in-separate-column
Store event kind in a separate column
2 parents 66f170c + cbd8c11 commit d4e4e24

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

functions/event_handler/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def store_pub_sub_event_in_bigquery(cloud_event):
3636
row = {
3737
"datetime": attributes.pop("datetime"),
3838
"uuid": attributes.pop("uuid"),
39+
"kind": event.pop("kind"),
3940
"event": event,
4041
"other_attributes": attributes,
4142
# Pull out some attributes into columns for querying.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="twined-gcp",
6-
version="0.4.0",
6+
version="0.5.0",
77
author="Marcus Lugg <marcus@octue.com>",
88
install_requires=[
99
"setuptools",

tests/test_event_handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_store_pub_sub_event_in_bigquery(self):
1616
cloud_event = MockCloudEvent(
1717
data={
1818
"message": {
19-
"data": base64.b64encode(b'{"some": "data"}'),
19+
"data": base64.b64encode(b'{"kind": "heart", "some": "data"}'),
2020
"attributes": {
2121
"datetime": "2024-04-11T09:26:39.144818",
2222
"uuid": "c8bda9fa-f072-4330-92b1-96920d06b28d",
@@ -44,6 +44,7 @@ def test_store_pub_sub_event_in_bigquery(self):
4444
{
4545
"datetime": "2024-04-11T09:26:39.144818",
4646
"uuid": "c8bda9fa-f072-4330-92b1-96920d06b28d",
47+
"kind": "heart",
4748
"event": {"some": "data"},
4849
"other_attributes": {
4950
"forward_logs": True,

0 commit comments

Comments
 (0)