From 04451f6969de513eb08d4ec91fa015ffcd58cd0a Mon Sep 17 00:00:00 2001 From: Sean Mackesey Date: Tue, 19 Sep 2023 16:14:25 -0400 Subject: [PATCH] [ext] add protocol version to all messages --- python_modules/dagster-ext/dagster_ext/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python_modules/dagster-ext/dagster_ext/__init__.py b/python_modules/dagster-ext/dagster_ext/__init__.py index 38366a039aeaf..323c3877e90a4 100644 --- a/python_modules/dagster-ext/dagster_ext/__init__.py +++ b/python_modules/dagster-ext/dagster_ext/__init__.py @@ -39,6 +39,9 @@ # ##### PROTOCOL # ######################## +# This represents the version of the protocol, rather than the version of the package. It must be +# manually updated whenever there are changes to the protocol. +PROTOCOL_VERSION = "0.1" ExtExtras = Mapping[str, Any] ExtParams = Mapping[str, Any] @@ -64,6 +67,7 @@ def _param_name_to_env_key(key: str) -> str: class ExtMessage(TypedDict): + __dagster_ext_version: str method: str params: Optional[Mapping[str, Any]] @@ -677,7 +681,7 @@ def __init__( self._materialized_assets: set[str] = set() def _write_message(self, method: str, params: Optional[Mapping[str, Any]] = None) -> None: - message = ExtMessage(method=method, params=params) + message = ExtMessage(__dagster_ext_version=PROTOCOL_VERSION, method=method, params=params) self._message_channel.write_message(message) # ########################