Skip to content

Commit

Permalink
[ext] add protocol version to all messages
Browse files Browse the repository at this point in the history
  • Loading branch information
smackesey committed Sep 22, 2023
1 parent b824aa3 commit 04451f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python_modules/dagster-ext/dagster_ext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]]

Expand Down Expand Up @@ -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)

# ########################
Expand Down

0 comments on commit 04451f6

Please sign in to comment.