Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sandy Ryza <[email protected]>
  • Loading branch information
clairelin135 and sryza committed Nov 14, 2023
1 parent 34b46b8 commit fb23a93
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1829,7 +1829,7 @@ def with_partitions_def(
class TimeWindowPartitionsSubsetSerializer(NamedTupleSerializer):
# TimeWindowPartitionsSubsets have custom logic to delay calculating num_partitions until it
# is needed to improve performance. When serializing, we want to serialize the number of
# partitions, so we force calculatation.
# partitions, so we force calculation.
def before_pack(self, value: "TimeWindowPartitionsSubset") -> "TimeWindowPartitionsSubset":
if value._asdict()["num_partitions"] is None:
return TimeWindowPartitionsSubset(
Expand All @@ -1840,9 +1840,7 @@ def before_pack(self, value: "TimeWindowPartitionsSubset") -> "TimeWindowPartiti
return value


@whitelist_for_serdes(
serializer=TimeWindowPartitionsSubsetSerializer,
)
@whitelist_for_serdes(serializer=TimeWindowPartitionsSubsetSerializer)
class TimeWindowPartitionsSubset(
BaseTimeWindowPartitionsSubset,
NamedTuple(
Expand Down

0 comments on commit fb23a93

Please sign in to comment.