Skip to content

Commit

Permalink
Fix SerializerManager typing
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Feb 21, 2025
1 parent b94145d commit 3adbc9f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions python/cudf_polars/cudf_polars/experimental/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import itertools
import operator
from functools import reduce
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, ClassVar

import cudf_polars.experimental.io
import cudf_polars.experimental.join
Expand All @@ -24,15 +24,17 @@
if TYPE_CHECKING:
from collections.abc import MutableMapping

from distributed import Client

from cudf_polars.containers import DataFrame
from cudf_polars.experimental.dispatch import LowerIRTransformer


class SerializerManager:
"""Manager to ensure ensure serializer is only registered once."""

_serializer_registered = False
_client_run_executed = set()
_serializer_registered: bool = False
_client_run_executed: ClassVar[set[str]] = set()

@classmethod
def register_serialize(cls) -> None:
Expand All @@ -44,7 +46,7 @@ def register_serialize(cls) -> None:
cls._serializer_registered = True

@classmethod
def run_on_cluster(cls, client) -> None:
def run_on_cluster(cls, client: Client) -> None:
"""Run serializer registration on the workers and scheduler."""
if (
client.id not in cls._client_run_executed
Expand Down

0 comments on commit 3adbc9f

Please sign in to comment.